home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
DB_CLIPP
/
3420A.ZIP
/
TW150L.ZIP
/
WINDEMO.PRG
< prev
Wrap
Text File
|
1992-04-12
|
98KB
|
2,756 lines
//------------------------------------------------------------------------
//
// WINDEMO.PRG
//
// Demonstration Program for TSDWIN.LIB
// Clipper 5.01 Window Library
//
// Copyright ( C ) 1991 Trilateral Systems Development Ltd.
// All Rights Reserved * Version 1.50 * Release Date: 01-25-92
//
// 18 Bond St. South
// Dundas, ON, Canada
// L9H 3H1
// 416-628-5086
//
//----- Documented: 06-15-91 at 09:52:51pm -------------------------------
//------------------------------------------------------------------------
// Preprocessor Directives
//------------------------------------------------------------------------
#include "achoice.ch"
#include "inkey.ch"
#include "tsdwin.ch"
#include "windemo.ch"
//------------------------------------------------------------------------
// File Wide Variable Declarations
//------------------------------------------------------------------------
STATIC nWin1, nWin2, nWin3, nWin4, nWin5, nWin6
STATIC nX, nY, aTempArray := { "", "", "", "", "", "" }
STATIC nMainChoice, nMenuLen, lMono
//------------------------------------------------------------------------
//
// FUNCTION Main( SThickness, ClrOK )
//
// Parameters:
//
// Return:
//
// Purpose:
//
//----- Documented: 06-15-91 at 09:52:51pm -------------------------------
FUNCTION Main( SThickness, ClrOK )
//------------------------------------------------------------------------
// Define LOCAL Variables for Main()
//------------------------------------------------------------------------
LOCAL aPrompts:={" «A» TSDWIN.LIB Features ", ;
" «B» Shadow Types ", ;
" «C» Border Types ", ;
" «D» Line Drawing ", ;
" «E» Box Drawing ", ;
" «F» Area Operations ", ;
" «G» Headers/Footers ", ;
" «H» Text Management ", ;
" «I» GETs and PROMPTs ", ;
" «J» Redisplaying ", ;
" «K» Reactivating ", ;
" «L» Moving/Sliding/Sizing ", ;
" «M» Picklists ", ;
" «N» Instance Variables. ", ;
" «O» TSDWIN Function List ", ;
" «P» BIG Stuff ", ;
" «Q» Run the Whole Demo!!! "}
LOCAL f, MenuAction:='', StackLen, nMenuRow, aMenu := {}
LOCAL DispArray:={}, cAction
MEMVAR nNum, nRow
AADD( DispArray, {"One of the most powerful features of «TSDWIN»", ;
"is its ability to operate on any window in", ;
"the stack. You can «write to either active»", ;
"«or inactive windows».", ;
"All the other features let you design YOUR", ;
"interface the way YOU want it. «TSDWIN» does", ;
"not interfere with «your personal style» of", ;
"interface design.", ;
"«TSDWIN» is a granular library. ONLY modules", ;
"you need are linked. We have respect for a", ;
"need to conserve memory and have designed", ;
"«TSDWIN» accordingly!", "", ;
"Your continued support is appreciated and", ;
"helps to make this the product YOU want."} )
AADD( DispArray, {"You can pick from «four shadow positions» or", ;
"have no shadow if you choose.", " ", ;
"«Shadow thickness», 1 or 2 lines on the sides", ;
"of the windows may be globally set.", ;
"Monochrome shadows are rendered with ASCII7", ;
"and Colour in ASCII8."} )
AADD( DispArray, {"There are «14 border types» to choose from. A", ;
"window's frame colour can be passed either", ;
"as a «character string or a 2 element array».", ;
"Therefore, you can have «one frame colour in»", ;
"«active windows and another for inactive».", " ", ;
"Wise use of colour can give you interesting", ;
"effects.", " ", ;
"Frame types can also be changed on the fly.", " ", ;
"Of course, you may opt to open windows with", ;
"no border, for example, twOpen() opens full", ;
"screen windows with no border in current", ;
"colours when no parameters are passed!"} )
AADD( DispArray, {"«Horizontal» and «vertical» line functions give", ;
"you «11 choices for horizontal» lines and «12»", ;
"«for vertical».", " ", ;
"You can choose colours other than those for", ;
"the default window text colour."} )
AADD( DispArray, {"You can put «boxes» anywhere within a window.", " ", ;
"There are «14 types» to choose from. Colour", ;
"is your choice anytime. Other library calls", ;
"normally made to windows may be used on", ;
"boxes. For example, you can scroll in a box", ;
"and either include or exclude the border."} )
AADD( DispArray, {"You can «fill», «clear», «colour» or «shadow» boxes", ;
"you make as well as «change the border» type.", " ", ;
"In all cases, you can include or exclude a", ;
"border area in the operation. «TSDWIN» offers", ;
"you wide flexibility, but the defaults make", ;
"common function calls easily."} )
AADD( DispArray, {"You can effortlessly make titles for your, ", ;
"windows. «TSDWIN» offers you two ways to make", ;
"your «headers» and «footers»:", " ", ;
"You can pass an array to twOpen() or define", ;
"them later with «twTitle()».", " ", ;
"The titles can be in any colour you choose, ", ;
"or you can default them to the window text", ;
"colour.", " ", ;
"You may also pass a «delimiter» string with", ;
"to further customize your window titles!"} )
AADD( DispArray, {"You can «justify», «center» or «position» text", ;
"anywhere you want in a window.", " ", ;
"«Replication» and a «typing mode» are at your", ;
"disposal.", "", ;
"You can «scroll» any region of a window, and", ;
"either include or exclude the border!", "", ;
"At all times you fully control all colour", ;
"selections, but can easily work with our", ;
"sensible defaults."} )
AADD( DispArray, {"You can easily create and position gets by", ;
"passing code blocks to «twGet()» or «twSayGet()»!", ;
"In this version, RANGE should be handled in", ;
"a VALID clause, but PICTURE, WHEN and VALID", ;
"are included.", " ", ;
"You can create menus with «twPrompt()». But if", ;
"you want to use your own get/menu systems, ", ;
"«TSDWIN» makes it easy for you to incorporate", ;
"your methods into the window system."} )
AADD( DispArray, {"You can «redisplay windows» from the stack", ;
"without activating them.", "", ;
"This is useful in lists you have previously", ;
"displayed and don't want to modify."} )
AADD( DispArray, {"Any window on the stack can be made «active»", ;
"in order that all other library functions", ;
"will operate on that window.", "", ;
"Remember, you can have «inactive and active»", ;
"«frame colours» defined differently.", "", ;
"As well as activating a window, which shows", ;
"in the foreground of the display, you can", ;
"also redirect all «TSDWIN» function output to", ;
"an inactive window. If you want to do that", ;
"you may have to do some bounds checking!"} )
AADD( DispArray, {"You can «MOVE», «SLIDE» and «SIZE» any active", ;
"window!! In all such cases, the shadow is", ;
"updated as the window moves.", "", ;
"The «twSize()» and «twSlide()» functions are big", ;
"and should be linked only if needed.", "", ;
"VMM swapping can create a problem when you", ;
"are using Clipper 5.0. If you have any, try", ;
"setting CLIPPER=E0000. These functions are", ;
"optimized for speed with 'C' or ASM code."} )
AADD( DispArray, {"There are functions which will let you show", ;
"«picklists» from «databases or arrays». «TSDWIN»", " ", ;
"adds «scrollbars» automatically and will also", ;
"use a default color scheme unless you want", ;
"define one. The default is SETCOLOR().", "", ;
"Functions like this are NOT linked in UNTIL", ;
"you call them! «TSDWIN» treats memory as a", ;
"precious commodity."} )
AADD( DispArray, {"You have access to the «instance variables»", ;
"for windows. You can use them to make your", ;
"own functions to operate within the «TSDWIN»", ;
"environment."} )
AADD( DispArray, {"«TSDWIN» Function List displayed with one of", ;
"the library MaxiFunctions, «twTextFile()»."} )
AADD( DispArray, {"«TSDWIN» has functions to «display messages» as", ;
"well as «alert boxes» which conform to the", ;
"operation and system conventions of similar", ;
"functions in MS-Windows.", "", ;
"«Push Button», «Radio» and «Select» box functions", ;
"are now included.", "", ;
"Configurable «DBF and Array browsers», «Index»", ;
"windows, a «Calculator», «Calendar» and message", ;
"systems are available.", "", ;
"Modest «communications» functions & «hardware»", ;
"add to the versatility of «TSDWIN»."})
AADD( DispArray, {"Some user input is required", "", ;
"during this demo."} )
nNum := 1; nRow := 0
//------------------------------------------------------------------------
// Initialize Global Statics
//------------------------------------------------------------------------
nMainChoice := 1; nMenuLen := LEN( aPrompts )
//------------------------------------------------------------------------
// Set Up Environment
//------------------------------------------------------------------------
SET CURSOR OFF
SET SCOREBOARD OFF
SET WRAP ON
//------------------------------------------------------------------------
// Link in the Screen Savers
//------------------------------------------------------------------------
EXTERNAL twSSaveAsc
EXTERNAL twWSaveAsc
SET KEY 287 TO twSSaveAsc
SET KEY 273 TO twWSaveAsc
//SET KEY 287 TO twSSaveMem
//SET KEY 273 TO twWSaveMem
IF SThickness == NIL
SThickness := '2'
ENDIF
IF ClrOK == NIL
lMono := .F.
ELSEIF UPPER( ClrOK ) == 'C'
lMono := .F.
ELSE
lMono := .T.
ENDIF
//------------------------------------------------------------------------
// Initialze window stack to thick or thin
// and allow for Monchrome Override if Graphics card installed
// Save environment and DOS screen
//------------------------------------------------------------------------
twInit( VAL( SThickness ))
twOpen()
twSaveScrEnv()
//------------------------------------------------------------------------
// Initialze Message and Alert colours
// Set Up Bright Backgrounds
//------------------------------------------------------------------------
If ! lMono
twMsgInit( , { INFOCLR, INQUCLR, WARNCLR, TEXTCLR, PMENCLR } )
twAlertInit( , { BUTCLR, RADCLR, CHKCLR } )
twAMsgInit( , { AINFOCLR, AWARNCLR } )
SETBLINK( .F. )
ENDIF
//------------------------------------------------------------------------
// Initialize the Mouse
//------------------------------------------------------------------------
twMouseInit()
//------------------------------------------------------------------------
// Open Main Display Window
//------------------------------------------------------------------------
twExplode( .T. )
twOpen( FULLSCREEN, MAINBLU, 5, 10 )
twExplode( .F. )
twTitle( "TSD Window Library Demonstration", BLU_WHI, "T", "C" )
twOpen( 2, 3, 23, 75, MAINBLU )
twTitle( "TSDWIN Demo Menu", CYH_BLU, "T", "C" )
twTitle( "Pick One and Be Amazed!", CYH_BLU, "B", "C" )
twCenter( 20, "Cursor Keys to Select : ENTER to View : ESC when Done", GNH_BLU )
KEYBOARD CHR( 32 )
DO WHILE .T.
nMenuRow := twRow( 0 )
twMenuInit( 2, twRow( 3 ), twCol( 30 ), IIF( ! lMono, "bg+/b,gr+/b", "w/n,w+/n" ), )
FOR nX = 1 TO nMenuLen - 1
cAction := "wProc" + PADL( STRINT( nX ), 2, '0' ) + "()"
@ ++nMenuRow, twCol( 0 ) WPROMPT aPrompts[ nX ] ;
MESSAGE DispArray[ nX ] ;
ACTION &cAction
NEXT
WMENU TO nMainChoice
IF nMainChoice = 0
EXIT
ENDIF
ENDDO
twPop()
//------------------------------------------------------------------------
// End The Demonstration
//------------------------------------------------------------------------
twScroll( 22, .F. )
SignOff()
Phones()
StackLen := LEN( _twStack())
FOR nX = 1 to StackLen
twPop()
NEXT
twRestScrEnv()
RETURN .T.
//------------------------------------------------------------------------
// End of Windemo.prg
//------------------------------------------------------------------------
//------------------------------------------------------------------------
//
// PROCEDURE wProc01()
//
// Purpose: TSDWIN.LIB Features
//
//----- Documented: 06-15-91 at 09:54:24pm --------------------------
PROCEDURE wProc01()
twOpen( FULLSCREEN, MAINBLU, 5, 9 )
IF ! lMono
SETBLINK( .F. )
ENDIF
twTitle( "TSDWIN.LIB Features", YEL_BLU, "T", "C" )
twCenter( 2, "Some of TSDWIN.LIB's Many Features...", CYH_BLU )
twInkeyWait( 2 )
twSay( 04, 16, " Select from Four Shadow Positions or None.", YEL_BLU )
twInkeyWait( 2 )
twSay( 05, 16, " Choose A Border Type for Your Window.", YEL_BLU )
twInkeyWait( 2 )
twSay( 06, 16, " You Can Draw Horizontal and Vertical Lines, ", YEL_BLU )
twInkeyWait( 2 )
twSay( 07, 16, " And 14 Types of Boxes.", YEL_BLU )
twInkeyWait( 2 )
twSay( 08, 16, " And You Can Shadow, Clear and Colour Your Boxes.", YEL_BLU )
twInkeyWait( 2 )
twSay( 09, 16, " You Can Position Titles Effortlessly.", YEL_BLU )
twInkeyWait( 2 )
twSay( 10, 16, " Elegant Text Management is Easy.", YEL_BLU )
twInkeyWait( 2 )
twSay( 11, 16, " You Can Display GETs and PROMPTs.", YEL_BLU )
twInkeyWait( 2 )
twSay( 12, 16, " Screens Can Be Redisplayed From the Stack.", YEL_BLU )
twInkeyWait( 2 )
twSay( 13, 16, " You Can Reactivate Previous Windows!", YEL_BLU )
twInkeyWait( 2 )
twSay( 14, 16, " You Can MOVE or SLIDE a Window!", YEL_BLU )
twInkeyWait( 2 )
twSay( 15, 16, " You Can Create picklists with ease!", YEL_BLU )
twInkeyWait( 2 )
twSay( 16, 16, " You Can Retrieve A Window's Instance Variables.", YEL_BLU )
twInkeyWait( 2 )
twSay( 17, 16, " Save Screens or Windows to MEM or ASCII Files.", GNH_BLU )
twInkeyWait( 2 )
twSay( 18, 16, " Choose Shadow Thickness.", GNH_BLU )
twInkeyWait( 2 )
twSay( 19, 16, " SMALL Kernel ( 24K ) Small is Beautiful!!", WHH_BLU )
twInkeyWait( 2 )
twSay( 20, 16, " Optimized for Speed.", WHH_BLU )
twInkeyWait( 2 )
twSay( 21, 16, " More Features Yet to Come", YEL_BLU )
twInkeyWait( 1 )
twScroll( 1, .F. )
twSay( 21, 16, " More MAXI Functions:", WHH_BLU )
twInkeyWait( 1 )
twScroll( 1, .F. )
twSay( 21, 16, " ACHOICES... TBROWSES...", WHH_BLU )
twInkeyWait( 1 )
twScroll( 1, .F. )
twSay( 21, 16, " Dialog Boxes, Alert Boxes...", WHH_BLU )
twInkeyWait( 1 )
twScroll( 1, .F. )
twSay( 21, 16, " Radio Boxes, Buttons...", WHH_BLU )
twScroll( 1, .F. )
twInkeyWait( 1 )
twSay( 21, 16, " And you STILL WON'T HAVE TO link them!", YEL_BLU )
twScroll( 3, .F. )
twInkeyWait( 1 )
twSay( 20, 16, " YOU help us decide what goes into TSDWIN.", GNH_BLU )
twSay( 21, 16, " SO YOU benefit from EVERYONE'S ideas!.", GNH_BLU )
twInkeyWait( 1 )
twTitle( "Press a Key or Wait...",, "B", "C" )
twInkeyWait( 3 )
twOpen( 3, 10, 13, 71, IIF( ! lMono, "n/*bg", "n/w" ), 1, 13 )
twCenter( 2, "TSDWIN.LIB" )
twCenter( 4, "Looks After the Details" )
twCenter( 6, "While YOU Use YOUR Expertise" )
twCenter( 8, "Where It COUNTS!" )
twTitle( "Press a Key or Wait...",, "B", "C" )
twInkeyWait( 3 )
twPop();twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc02()
//
// Purpose: Show Shadow Types
//
//----- Documented: 06-15-91 at 09:54:41pm --------------------------
PROCEDURE wProc02()
LOCAL nWin1, nHandle
nWin1 := twOpen( FULLSCREEN, WHH_BLU, 5, 9, "" )
twTitle( "Window Shadows", BLU_WHH, "T", "C" )
twTitle( "Press a Key or Wait", BLU_WHH, "B", "C" )
twOpen( 3, 5, 9, 34, RDH_CYH, 1, 2 )
twCenter( 3, "Shadow Type 1" )
twOpen( 3, 45, 9, 74, RDH_CYH, 7, 2 )
twCenter( 3, "Shadow Type 7" )
twOpen( 13, 5, 19, 34, RDH_CYH, 9, 2 )
twCenter( 3, "Shadow Type 9" )
twOpen( 13, 45, 19, 74, RDH_CYH, 3, 2 )
twCenter( 3, "Shadow Type 3" )
twInkeyWait( 3 )
nHandle := _twHandle( nWin1 )
BEEPER
twCenter( 22, " Remember, You can Change the Thickness with twInit() ", ;
YEL_BLU )
twInkeyWait( 3 )
FOR nX = 1 TO 5
twPop()
NEXT
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc03()
//
// Purpose: Show Border Types
//
//----- Documented: 06-15-91 at 09:55:06pm --------------------------
PROCEDURE wProc03()
LOCAL nRow, nCol, nHandle, aTitle, nMainWin
LOCAL win01, win02, win03, win04, win05, win06, win07, win08, win09
LOCAL nWin10, nWin11, nWin12, nWin13, nWin14, winnum:={}
LOCAL aTempArray := { CYH_GRN, GNH_VIO, WHH_VIH, YEL_RDH, BLA_GNH, WHH_BLH, ;
RDH_YLH, RED_YLH, GRN_WHH, BLH_CYN, BLA_YLH, RDH_GNH, ;
YEL_WHH, CYH_RDH, MAINRED }
nMainWin := twOpen( FULLSCREEN, IIF( ! lMono, ;
"b+/b", "w+/n" ), 5, 12, "▒" )
twTitle( "Window Borders", BLU_WHH, "T", "C" )
twTitle( "Press a Key or Wait", BLU_WHH, "B", "C" )
nCol:=-4
FOR nX = 1 TO 14
nRow := IIF( nX > 7, 9, 2 )
nCol := nCol + 10
AADD( winnum, "win" + PADL( STRINT( nX ), 2, "0" ))
winnum[ nX ] := twOpen( nRow, nCol, nRow + 5, nCol + 7, RDH_CYH, 5, nX )
twCenter( 2, "Type" );twCenter( 3, STRINT( nX ))
nCol := IIF( nX == 7, -4, nCol )
NEXT
twInkeyWait( 3 )
BEEPER
nHandle := _twHandle( nMainWin )
aTitle := _twTitle()
twCenter( 16, " You can change the frame Type of any window! ", YEL_BLU )
twInkeyWait( 1 )
FOR nX = 1 TO 14
twFrame( nX, YEL_BLU );twPutTitles( aTitle );twInkeyWait( .5 )
NEXT
BEEPER
_twHandle( nMainWin )
twCenter( 18, " Or the Colour! ", YEL_BLU )
twInkeyWait( 1 )
FOR nX = 1 to 14
_twHandle( winnum[ nX ] )
twFrame( _twFrame(), aTempArray[ nX ] )
twInkeyWait( .1 )
NEXT
twInkeyWait( 1 )
BEEPER
_twHandle( nMainWin )
twCenter( 20, " The Frame Colour can be a Two Element Array ", CYH_BLU )
twCenter( 21, " To Allow Active/Inactive Windows to have ", CYH_BLU )
twSay( 22, 21, " Separate Colours.", CYH_BLU )
twInkeyWait( 1 )
twType( 22, 39, " ( Like MS-Windows ) ", WHH_BLU, .F. )
twInkeyWait( 1 )
_twHandle( nHandle )
twInkeyWait( 6 )
FOR nX = 1 TO 15
twPop()
NEXT
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc04()
//
// Purpose: Show Line Types
//
//----- Documented: 06-15-91 at 09:55:21pm --------------------------
PROCEDURE wProc04()
LOCAL nType
twOpen( 7, 8, 21, 73, YEL_CYN, 1, 9 )
twTitle( "Line Types",, "T", "C" )
twTitle( "Key or Wait",, "B", "C" )
twTitle( "Horizontal", RED_CYN, "B", "L" )
FOR nX = 1 TO 11
nType := PADL( STRINT( nX ), 2 )
twLeft( nX + 1, " Type " + nType + ":" )
twHLine( nX + 1, 15, 09, nX, RED_CYN )
NEXT
twTitle( "Vertical", BLU_CYN, "B", "R" )
@ twRow( 2 ), twCol( 44 ) say "Types"
@ twRow( 3 ), twCol( 26 ) say " 1 2 3 4 5 6 7 8 9 10 11 12"
FOR nX = 1 TO 12
twVLine( 5, 28 + 3 * ( nX - 1 ), 8, nX, BLU_CYN )
NEXT
twInkeyWait( 6 )
twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc05()
//
// Purpose: Show Box Types
//
//----- Documented: 06-15-91 at 09:55:33pm --------------------------
PROCEDURE wProc05()
LOCAL cFilChrs := "* ░▒▓█"
LOCAL nRow, nCol
LOCAL cClrStrs := { YEL_CYN, YEL_RED, GRN_WHH, WHH_VIH, RED_YLH, BLA_YLH, ;
MAINRED, BLU_CYN, RDH_CYH, WHH_VIH, YEL_CYH, YEL_BLU, ;
YEL_GRN, WHH_BLA }
//*************************
// Demonstrate Boxes
//*************************
twOpen( FULLSCREEN, RDH_BLU, 1, 9 )
FOR nY = 1 TO 3
IF nY == 1
twTitle( "Box Types",, "T", "C" )
ELSEIF nY == 2
twTitle( "Box Types in Colours",, "T", "C" )
ELSEIF nY == 3
twTitle( "Filled Box Types in Colour",, "T", "C" )
ENDIF
nCol := -5
FOR nX = 1 TO 14
nRow := IIF( nX > 7, 13, 4 )
nCol := nCol + 10
IF nY == 1
twBox( nRow, nCol, nRow + 5, nCol + 7, nX, YEL_BLU )
ELSEIF nY == 2
twBox( nRow, nCol, nRow + 5, nCol + 7, nX, cClrStrs[ nX ] )
ELSEIF nY == 3
twBox( nRow, nCol, nRow + 5, nCol + 7, nX, cClrStrs[ nX ], ;
SUBSTR( cFilChrs, nX, 1 ))
ENDIF
nCol := IIF( nX == 7, -5, nCol )
NEXT
twInkeyWait( 2 )
IF nY == 1
BEEPER
twTitle( "Draw Them In Different Colours",, "B", "C" )
twInkeyWait( 2 )
ELSEIF nY == 2
BEEPER
twTitle( "And Fill Them While You Make Them!",, "B", "C" )
twInkeyWait( 2 )
ENDIF
NEXT
twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc06()
//
// Purpose: Shadow, Clear, Fill and Colour Boxes
//
//------------------------------------------------------------------------
PROCEDURE wProc06()
LOCAL nCol := 14, nRow := 4
//***************************
// Shadow the Boxes
//***************************
twOpen( FULLSCREEN, WHH_BLU, 5, 9, "" )
twTitle( "Boxes with Shadows",, "T", "C" )
twTitle( "Press a Key or Wait",, "B", "C" )
twBox( nRow, nCol, nRow + 6, nCol + 20, 1, BLA_CYH, " " )
twShadow( nRow, nCol, nRow + 6, nCol + 20, 7 )
twSay( nRow + 01, nCol + 3, "████████", RDH_CYH )
twSay( nRow + 02, nCol + 3, " ██ ", RDH_CYH )
twSay( nRow + 03, nCol + 3, " ██ ", RDH_CYH )
twSay( nRow + 04, nCol + 3, " ██ ", RDH_CYH )
twSay( nRow + 05, nCol + 3, " ██ ", RDH_CYH )
twSay( nRow + 05, nCol + 9, "RILATERAL", BLU_CYH )
twBox( nRow, nCol + 32, nRow + 6, nCol + 52, 1, BLA_CYH, " " )
twShadow( nRow, nCol + 32, nRow + 6, nCol + 52, 9 )
twSay( nRow + 01, nCol + 35, "████████", YEL_CYH )
twSay( nRow + 02, nCol + 35, "██ ", YEL_CYH )
twSay( nRow + 03, nCol + 35, "████████", YEL_CYH )
twSay( nRow + 04, nCol + 35, " ██", YEL_CYH )
twSay( nRow + 05, nCol + 35, "████████", YEL_CYH )
twSay( nRow + 05, nCol + 44, "YSTEMS", BLU_CYH )
twBox( nRow + 9, nCol, nRow + 15, nCol + 24, 1, BLA_CYH, " " )
twShadow( nRow + 9, nCol, nRow + 15, nCol + 24, 1 )
twSay( nRow + 10, nCol + 3, "████████", WHI_CYH )
twSay( nRow + 11, nCol + 3, "██ ▐", WHI_CYH )
twSay( nRow + 12, nCol + 3, "██ ▐", WHI_CYH )
twSay( nRow + 13, nCol + 3, "██ ▐", WHI_CYH )
twSay( nRow + 14, nCol + 3, "████████", WHI_CYH )
twSay( nRow + 14, nCol + 12, "EVELOPMENT", BLU_CYH )
twBox( nRow + 9, nCol + 32, nRow + 15, nCol + 52, 1, BLA_CYH, " " )
twShadow( nRow + 9, nCol + 32, nRow + 15, nCol + 52, 3 )
twSay( nRow + 12, nCol + 39, "Limited", BLU_CYH )
twInkeyWait( 2 )
BEEPER
//***************************
// Demonstrate Box Clearing
//***************************
twTitle( "You Can Clear a Box", YEL_BLU, "B", "C" )
twInkeyWait( 2 )
twClear( .F., " ", nRow, nCol, nRow + 6, nCol + 20 )
twInkeyWait( 2 )
BEEPER
twTitle( "Or Include the Border", YEL_BLU, "B", "C" )
twInkeyWait( 2 )
twClear( .T., " ", nRow, nCol + 32, nRow + 6, nCol + 52 )
twInkeyWait( 2 )
BEEPER
twTitle( "And You Can Fill It While Clearing", YEL_BLU, "B", "C" )
twInkeyWait( 2 )
twClear( .T., "▒", nRow + 9, nCol, nRow + 15, nCol + 24 )
twInkeyWait( 2 )
twClear( .F., "▒", nRow + 9, nCol + 32, nRow + 15, nCol + 52 )
twInkeyWait( 2 )
BEEPER
//****************************************
// Demonstrate Colour Attribute Changing
//****************************************
twTitle( "You Can Also Change the Colour Attribute of any Region.", YEL_BLU, "B", "C" )
twInkeyWait( 2 )
twSay( nRow + 11, nCol + 3, "See What" )
twAttrib( .T., YEL_RED, nRow + 9, nCol, nRow + 15, nCol + 24 )
twInkeyWait( 2 )
twSay( nRow + 11, nCol + 35, "I Mean" )
twAttrib( .F., IIF( ! lMono, "w+/br*", "w+/n" ), nRow + 9, nCol + 32, nRow + 15, nCol + 52 )
twInkeyWait( 1 )
twAttrib( .F., IIF( ! lMono, "b+/w", "n/w" ))
twInkeyWait( 1 )
twAttrib( .T., IIF( ! lMono, "gr+/rb", "w+/n" ))
twInkeyWait( 2 )
twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc07()
//
// Purpose: Display Headers and Footer for Windows
// Justification, Colour and Delimiters
//
//----- Documented: 06-15-91 at 09:56:33pm --------------------------
PROCEDURE wProc07()
LOCAL temp
LOCAL cClrStrs := { YEL_CYN, YEL_RED, GRN_WHH, WHH_VIH, RED_YLH, BLA_YLH, ;
MAINRED, BLU_CYN, RDH_CYH, WHH_VIH, YEL_CYH, YEL_BLU, ;
YEL_GRN, WHH_BLA }
twOpen( 7, 10, 17, 70, RDH_CYH, 1, 2 )
twLeft( 3, " You can center headers." )
twInkeyWait( 1 )
twTitle( "Trilateral Systems",, "T", "C" )
twInkeyWait( 1 )
@ twRow( 3 ), twCol( 27 ) SAY "Or right and left justify them!"
twInkeyWait( 1 )
twTitle( "LEFT",, "T", "L" )
twInkeyWait( 1 )
twTitle( "RIGHT",, "T", "R" )
twInkeyWait( 1 )
twCenter( 5, " You can do the same with footers." )
twInkeyWait( 1 )
twTitle( "Window Library",, "B", "C" )
twInkeyWait( 1 )
twTitle( "LEFT",, "B", "L" )
twInkeyWait( 1 )
twTitle( "RIGHT",, "B", "R" )
twInkeyWait( 1 )
twCenter( 7, " You can even choose their colour!" )
twInkeyWait( 1 )
ACOPY( cClrStrs, aTempArray, 1, 6 )
twTitle( "Trilateral Systems", aTempArray[1], "T", "C" )
twInkeyWait( 1 )
twTitle( "LEFT", aTempArray[2], "T", "L" )
twInkeyWait( 1 )
twTitle( "RIGHT", aTempArray[3], "T", "R" )
twInkeyWait( 1 )
twTitle( "Window Library", aTempArray[4], "B", "C" )
twInkeyWait( 1 )
twTitle( "LEFT", aTempArray[5], "B", "L" )
twInkeyWait( 1 )
twTitle( "RIGHT", aTempArray[6], "B", "R" )
twInkeyWait( 1 )
FOR nX = 1 TO 5
twTitle( "LEFT", aTempArray[1], "T", "L" )
twInkeyWait( .01 )
twTitle( "Trilateral Systems", aTempArray[2], "T", "C" )
twInkeyWait( .01 )
twTitle( "RIGHT", aTempArray[3], "T", "R" )
twInkeyWait( .01 )
twTitle( "RIGHT", aTempArray[4], "B", "R" )
twInkeyWait( .01 )
twTitle( "Window Library", aTempArray[5], "B", "C" )
twInkeyWait( .01 )
twTitle( "LEFT", aTempArray[6], "B", "L" )
//********************
// rotate the array
//********************
temp := aTempArray[1]
ADEL( aTempArray, 1 )
aTempArray[6] := temp
NEXT
twInkeyWait( 2 )
twCenter( 6, "Delimiters can be inserted.", RDH_CYH )
twInkeyWait( 2 )
ACOPY( cClrStrs, aTempArray, 7, 6 )
FOR nX = 1 TO 5
twTitle( "LEFT", aTempArray[1], "T", "L", "[]" )
twInkeyWait( .01 )
twTitle( "Trilateral Systems", aTempArray[2], "T", "C", "" )
twInkeyWait( .01 )
twTitle( "RIGHT", aTempArray[3], "T", "R", "**" )
twInkeyWait( .01 )
twTitle( "RIGHT", aTempArray[4], "B", "R", "╣╠" )
twInkeyWait( .01 )
twTitle( "Window Library", aTempArray[5], "B", "C", "││" )
twInkeyWait( .01 )
twTitle( "LEFT", aTempArray[6], "B", "L", "╡╞" )
//*******************************
// swap first and last elements
//*******************************
temp := aTempArray[1]
ADEL( aTempArray, 1 )
aTempArray[6] := temp
NEXT
twInkeyWait( 4 )
twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc08()
//
// Purpose: Demonstrate Text Positioning in a Window
// Justification
// Replication
// Positioning
// Colours
// Typing
// Scrolling
//
//----- Documented: 06-15-91 at 09:56:46pm --------------------------
PROCEDURE wProc08()
LOCAL cClrStrs := { YEL_CYN, YEL_RED, GRN_WHH, WHH_VIH, RED_YLH, BLA_YLH, ;
MAINRED, BLU_CYN, RDH_CYH, WHH_VIH, YEL_CYH, YEL_BLU, ;
YEL_GRN, WHH_BLA }
LOCAL cClrTemp
ACOPY( cClrStrs, aTempArray, 1, 6 )
twOpen( 1, 10, 22, 70, WHH_GRN, 3, 9 )
twTitle( "Text Management",, "T", "C" )
twInkeyWait( 1 )
twLeft( 2, "It's easy to left justify text." )
twInkeyWait( 1 )
twCenter( 4, "And center it too!" )
twInkeyWait( 1 )
twRight( 6, "You can right justify, of Course." )
twInkeyWait( 1 )
twLeft( 8, " You can replicate any character." )
twInkeyWait( 1 )
twReplicate( 8, 35, "■", 24 )
twInkeyWait( 1 )
twCenter( 10, "You can also:" )
twInkeyWait( 1 )
twSay( 12, 10 + 4, "PUT" )
twInkeyWait( .1 )
twSay( 13, 12 + 4, "TEXT" )
twInkeyWait( .1 )
twSay( 14, 14 + 4, "ANYWHERE" )
twInkeyWait( .1 )
twSay( 15, 12 + 4, "YOU" )
twInkeyWait( .1 )
twSay( 16, 10 + 4, "WANT" )
twInkeyWait( 1 )
cClrTemp := aTempArray[6]
twSay( 12, 46 - 5, " In ", aTempArray[1] )
twInkeyWait( .1 )
twSay( 13, 44 - 5, " Any ", aTempArray[2] )
twInkeyWait( .1 )
twSay( 14, 42 - 5, " Colour ", aTempArray[3] )
twInkeyWait( .1 )
twSay( 15, 44 - 5, " You ", aTempArray[4] )
twInkeyWait( .1 )
twSay( 16, 46 - 5, " Want ", aTempArray[5] )
twInkeyWait( 1 )
//***********************************
// Demonstrate Typing and Scrolling
//***********************************
twType( 18, 10, "You can emulate a typewriter if you want.", YEL_GRN, .T. )
twType( 19, 11, " And you can turn off the sound, too! ", YEL_BLU, .F. )
twScroll( 2, .F. )
twType( 19, 17, "Scrolling your screen can",, .F. )
twScroll( 1, .F. )
twType( 19, 17, "make your application look",, .F. )
twScroll( 1, .F. )
twType( 19, 17, "neat. With the TSD Window",, .F. )
twScroll( 1, .F. )
twType( 19, 17, "Library you can scroll all",, .F. )
twScroll( 1, .F. )
twType( 19, 17, "or part of a window, with",, .F. )
twScroll( 1, .F. )
twType( 19, 17, "or without the border. ",, .F. )
FOR nX = 1 TO 12
twScroll( 1, .F. )
twInkeyWait( .2 )
NEXT
twBox( 9, 4, 19, 27, 1, BLA_CYH )
twShadow( 9, 4, 19, 27, 1 )
twBox( 9, 33, 19, 56, 1, BLA_CYH )
twShadow( 9, 33, 19, 56, 3 )
nX := 1
DO WHILE nX <= 6
twSay( 10, 05, " Use Your Imagination ", YEL_RDH )
twSay( 18, 34, " Use Your Imagination ", YEL_RDH )
twInkeyWait( .1 )
twScroll( -1, .F., 10, 5, 18, 26 )
twScroll( 1, .F., 10, 34, 18, 55 )
twInkeyWait( .1 )
twSay( 10, 05, " ** Have a Ball ** ", BLA_GNH )
twSay( 18, 34, " ** Have a Ball ** ", BLA_GNH )
twInkeyWait( .1 )
twScroll( -1, .F., 10, 5, 18, 26 )
twScroll( 1, .F., 10, 34, 18, 55 )
twInkeyWait( .1 )
twSay( 10, 05, " CLIPPERING is a joy, ", WHH_BLH )
twSay( 18, 34, " CLIPPERING is a joy, ", WHH_BLH )
twInkeyWait( .1 )
twScroll( -1, .F., 10, 5, 18, 26 )
twScroll( 1, .F., 10, 34, 18, 55 )
twInkeyWait( .1 )
twSay( 10, 05, " with TSD's Windows ", RDH_YLH )
twSay( 18, 34, " with TSD's Windows ", RDH_YLH )
twInkeyWait( .1 )
twScroll( -1, .F., 10, 5, 18, 26 )
twScroll( 1, .F., 10, 34, 18, 55 )
twInkeyWait( .1 )
nX++
ENDDO
twSay( 10, 05, " **Happy Clippering** ", WHH_VIH )
twSay( 18, 34, " **Happy Clippering** ", WHH_VIH )
twInkeyWait( 2 )
twScroll( 22, .T. )
twInkeyWait( .5 )
twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc09()
//
// Purpose: Display and Process GETs and PROMPTs
//
//----- Documented: 06-15-91 at 09:56:59pm --------------------------
PROCEDURE wProc09()
LOCAL GetTry1 := SPACE( 10 ), GetTry2 := SPACE( 15 )
LOCAL GetTry3 := SPACE( 10 ), GetTry4 := SPACE( 12 )
LOCAL GetList := {}, mChoice, tCursor, aMenu := {}
twOpen( FULLSCREEN, MAINRED, 5, 6, "∙" )
twTitle( "Get Processing",, "T", "C" )
twSay( 21, 5, " First Get Allows Digits Except '9' ", CYH_RED )
twSay( 22, 5, " Second Get is in Uppercase : ESC When Done ", CYH_RED )
twInkeyWait( 1 )
KEYBOARD CHR( 32 ) + CHR( 32 ) + CHR( 32 ) + CHR( 32 )
FourWin()
twTitle( "Using twGet()",, "T", "C" )
twClear( .F., " " )
twCenter( 1, "Try entering data here:" )
twSay( 3, 8, "Get #1:" )
twSay( 5, 8, "Get #2:" )
tCursor := SET( _SET_CURSOR, 1 )
twGet( 4, 9, {| cVal | IIF( cVal == NIL, GetTry1, GetTry1 := cVal )}, ;
"GetTry1", ;
GetList, ;
REPL( "9", LEN( GetTry1 )),,, ;
{|| !( "9" $ GetTry1 )} )
twGet( 6, 9, {| cVal | IIF( cVal == NIL, GetTry2, GetTry2 := cVal )}, ;
"GetTry2", ;
GetList, ;
"@!" )
IF nMainChoice == nMenuLen
KEYBOARD "12345" + CHR( 13 ) + "hello" + CHR( 13 )
ENDIF
FOR nX = 1 to LEN( GetList );GetList[ nX ]:display();NEXT
twReadModal( GetList );GetList := {}
IF nMainChoice == nMenuLen
twInkeyWait( 2 )
ENDIF
twActivate( nWin3 )
twTitle( "Using twSayGet()",, "T", "C" )
twClear( .F., " " )
twCenter( 6, "Same Gets, Same Rules!" )
twCenter( 8, "You can define the GET" )
twCenter( 9, "However you want!" )
twSayGet( 3, 3, "Get Number 1:",,, ;
{| cVal | IIF( cVal == NIL, GetTry3, GetTry3 := cVal )}, ;
"GetTry3", ;
GetList, ;
REPL( "9", LEN( GetTry3 )),,, ;
{|| !( "9" $ GetTry3 )} )
twSayGet( 4, 3, "Get Number 2:",,, ;
{| cVal | IIF( cVal == NIL, GetTry4, GetTry4 := cVal )}, ;
"GetTry4", ;
GetList, ;
"@!" )
IF nMainChoice == nMenuLen
KEYBOARD "12345" + CHR( 13 ) + "hello" + CHR( 13 )
ENDIF
FOR nX = 1 to LEN( GetList );GetList[ nX ]:display();NEXT
twReadModal( GetList );GetList := {}
IF nMainChoice == nMenuLen
twInkeyWait( 2 )
ENDIF
SET( _SET_CURSOR, tCursor )
twActivate( nWin2 )
twTitle( "Using twPrompt() for Menus", BLA_WHI, "T", "C" )
twTitle( " - Move : ┘ - Select", BLA_WHI, "B", "C" )
twPrompt( 02, 11, "This is Choice 1" )
twPrompt( 04, 11, "This is Choice 2" )
twPrompt( 06, 11, "This is Choice 3" )
IF nMainChoice == nMenuLen
KEYBOARD CHR( 24 ) + CHR( 13 )
ENDIF
MENU TO mChoice
twCenter( 09, "You Picked " + STRINT( mChoice ), WHH_VIH )
twInkeyWait( 3 )
twActivate( nWin4 ) // To Look after the stack
FOR nX = 1 TO 5
twPop()
twInkeyWait( .1 )
NEXT
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc10()
//
// Purpose: Demonstrate Redisplay Feature
// Pop up from the Stack
//
//----- Documented: 06-15-91 at 09:57:11pm --------------------------
PROCEDURE wProc10()
SET SCOREBOARD OFF
twOpen( FULLSCREEN, WHH_BLU, 5, 9, "" )
twTitle( "Redisplay from the Stack",, "T", "C" )
FournWin2()
twDisplay( nWin1 );twInkeyWait( .2 )
twDisplay( nWin3 );twInkeyWait( .2 )
twDisplay( nWin2 );twInkeyWait( .2 )
twDisplay( nWin4 );twInkeyWait( .2 )
twDisplay( nWin1 );twInkeyWait( .2 )
twDisplay( nWin3 );twInkeyWait( .2 )
twDisplay( nWin4 );twInkeyWait( .2 )
IF nMainChoice != nMenuLen
@ twRow( 04 ), twCol( 2 ) SAY " Shadows"
@ twRow( 05 ), twCol( 2 ) SAY "Information"
@ twRow( 06 ), twCol( 2 ) SAY " Is Also"
@ twRow( 07 ), twCol( 2 ) SAY " Updated"
@ twRow( 08 ), twCol( 2 ) SAY " ---------"
@ twRow( 09 ), twCol( 2 ) SAY " Try it"
@ twRow( 10 ), twCol( 2 ) SAY " Yourself!"
@ twRow( 11 ), twCol( 2 ) SAY " ---------"
@ twRow( 12 ), twCol( 2 ) SAY " With F1"
@ twRow( 13 ), twCol( 2 ) SAY " F2, F3"
@ twRow( 14 ), twCol( 2 ) SAY " and F4"
@ twRow( 15 ), twCol( 2 ) SAY " ---------"
@ twRow( 16 ), twCol( 2 ) SAY " ESC "
@ twRow( 17 ), twCol( 2 ) SAY " to go on "
SET KEY 28 TO DnWin1
SET KEY -1 TO DnWin2
SET KEY -2 TO DnWin3
SET KEY -3 TO DnWin4
twInkeyWait( 60 )
SET KEY 28 to
SET KEY -1 to
SET KEY -2 to
SET KEY -3 to
ELSE
twInkeyWait( 2 )
ENDIF
FOR nX = 1 TO 5
twPop()
NEXT
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc11()
//
// Purpose: Demonstrate Window Activation Feature
//
//----- Documented: 06-15-91 at 09:57:23pm --------------------------
PROCEDURE wProc11()
LOCAL nCol, nRow, nPos, nCounter := 0, cTemp := '', nZ
LOCAL nWindow := 0, nFrame := 0, aHandle := {}
twOpen( FULLSCREEN, MAINRED, 5, 9, "" )
twTitle( "Window Activation Features",, "T", "C" )
FourWin()
twActivate( nWin1 )
Scroller()
twSave()
nPos := nRow := 0
FOR nCol = 5 TO 55
nRow := INT( nRow )
IF nRow != nPos .AND. nRow != 3
AADD( aHandle, twOpen( nRow, nCol, nRow + 5, nCol + 20, WHH_BLU, 6, 3 ))
nFrame++
nFrame := IIF( nFrame > 14, 1, nFrame )
twFrame( nFrame )
nWindow++
cTemp := "Window " + STRINT( nWindow )
twTitle( cTemp, BLU_CYH, "T", "C" )
cTemp := "Frame " + STRINT( nFrame )
twTitle( cTemp,, "B", "C" )
ELSEIF nRow = 3
nCounter++
IF nCounter = 6
AADD( aHandle, twOpen( nRow, nCol, nRow + 5, nCol + 20, WHH_BLU, 6, 3 ))
nFrame++
nFrame := IIF( nFrame > 14, 1, nFrame )
twFrame( nFrame )
nWindow++
cTemp := "Window " + STRINT( nWindow )
twTitle( cTemp, BLU_CYH, "T", "C" )
cTemp := "Frame " + STRINT( nFrame )
twTitle( cTemp,, "B", "C" )
ENDIF
ENDIF
nPos := nRow
NEXT
twInkeyWait( .1 )
FOR nX = 1 TO LEN( aHandle )
twActivate( aHandle[ nX ] );twCenter( 1, "Active!" );twInkeyWait( .1 )
IF nX = 8
twActivate( nWin1 );Scroller()
ELSEIF nX = 12
twActivate( nWin2 );twInkeyWait( .1 )
twCenter( 4, "My Turn!!" );twInkeyWait( 2 )
ELSEIF nX = 23
twActivate( nWin3 );twInkeyWait( .1 )
twCenter( 4, "Butt out! My Turn!!" );twInkeyWait( 2 )
ELSEIF nX = 26
twActivate( nWin4 );twInkeyWait( .1 )
twCenter( 4, "I'm Moving!!" );twInkeyWait( 2 )
twMove( -10, -40 );twInkeyWait( .1 )
ENDIF
NEXT
twInkeyWait( .1 )
FOR nX = LEN( aHandle ) TO 1 STEP -1
twActivate( aHandle[ nX ] );twCenter( 2, "And Again!!" );twInkeyWait( .1 )
IF nX = 18
twActivate( nWin1 );Scroller()
ELSEIF nX = 12
twActivate( nWin2 );twInkeyWait( .1 )
twCenter( 6, "Stop Pushing!!" );twInkeyWait( 1 )
ELSEIF nX = 10
twActivate( nWin3 );twInkeyWait( .1 )
twCenter( 6, "Quiet You!!" );twInkeyWait( 1 )
ELSEIF nX = 5
twActivate( nWin4 );twInkeyWait( .1 )
twCenter( 6, "Ahhrrrghhh!!" );twInkeyWait( 1 )
FOR nZ = 1 TO 14
twFrame( nZ, YEL_CYN );twInkeyWait( .1 )
NEXT
ENDIF
NEXT
twInkeyWait( 1 )
FOR nX = 1 TO LEN( aHandle )
twActivate( aHandle[ nX ] )
twTitle( "How's That??", YEL_RED, "B", "C" )
Inkey()
NEXT
twInkeyWait( 2 )
FOR nX = 1 TO 5 + LEN( aHandle )
twPop()
Inkey()
NEXT
//*********************************
// frame testing
//*********************************
twOpen( FULLSCREEN, MAINBLU, 3, 3 )
twTitle( "Frames in Window Activation",, "T", "C" )
twInkeyWait( 1 )
twCenter( 2, "The Frame Colour may be passed as a two element array.", YEL_BLU )
twInkeyWait( 1 )
twCenter( 4, "This feature enables you define one colour for active", YEL_BLU )
twCenter( 5, "and another for inactive ones, much like Microsoft Windows!", YEL_BLU )
twInkeyWait( 1 )
twCenter( 7, "Try it and See!!", GNH_BLU )
twInkeyWait( 1 )
twLeft( 20, " ACTIVE KEYS ", WHH_VIH )
twLeft( 21, " 1, 2, 3, 4 ", BLA_CYH )
twLeft( 22, " To Reactivate ", BLA_CYH )
twLeft( 23, " ESC to Exit ", BLA_CYH )
twInkeyWait( 1 )
nWin1 := twOpen( 12, 31, 19, 62, WHI_RED, 3, 3,, { WHH_RED, WHI_RED } )
twTitle( "Win 1",, "T", "C" )
twCenter( 2, "Window 1" )
nWin2 := twOpen( 10, 52, 22, 69, BLA_CYN, 3, 3,, { WHH_CYN, WHI_CYN } )
twTitle( "Win 2",, "T", "C" )
twCenter( 2, "Window 2" )
nWin3 := twOpen( 8, 8, 17, 37, WHI_BLA, 3, 3,, { WHH_BLA, WHI_BLA } )
twTitle( "Win 3",, "T", "C" )
twCenter( 2, "Window 3" )
nWin4 := twOpen( 6, 33, 15, 59, WHI_VIO, 3, 3,, { WHH_VIO, WHI_VIO } )
twTitle( "Win 4",, "T", "C" )
twCenter( 2, "Window 4" )
IF nMainChoice != nMenuLen
SET KEY 49 TO AnWin1;SET KEY 50 TO AnWin2
SET KEY 51 TO AnWin3;SET KEY 52 TO AnWin4
DO WHILE .T.
twInkeyWait( 600 )
IF LASTKEY() == 27
EXIT
ENDIF
ENDDO
SET KEY 49 to;SET KEY 50 to;SET KEY 51 to;SET KEY 52 to
ELSE
Inkey( 1 );AnWin1()
Inkey( 1 );AnWin3()
Inkey( 1 );AnWin4()
Inkey( 1 );AnWin2()
Inkey( 2 )
ENDIF
FOR nX = 1 TO 5
twPop()
NEXT
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc12()
//
// Purpose: Demonstrate Moving, Sliding and Sizing a Window
//
//----- Documented: 06-15-91 at 09:57:38pm --------------------------
PROCEDURE wProc12()
LOCAL nMainWin, nHandle
nMainWin := twOpen( FULLSCREEN, WHH_BLU, 5, 9, "" )
twTitle( "Moving, Sliding and Sizing Windows",, "T", "C" )
FournWin2()
nWin5 := twOpen( 2, 40, 12, 59, RED_YLH, 9, 2 );twTitle( "Win 5",, "T", "C" )
twSay( 2, 3, "Watch me move!" );twInkeyWait( 2 )
twSay( 2, 3, "38 Left " );twInkeyWait( .3 )
twMove( 0, -38 );twInkeyWait( .3 )
twSay( 3, 3, "10 Down" );twInkeyWait( .3 )
twMove( 10, 0 );twInkeyWait( .3 )
twSay( 5, 3, "7 Up" );twSay( 6, 3, "30 Right" );twInkeyWait( .3 )
twMove( -7, 30 );twInkeyWait( 1 )
twPop()
nWin6 := twOpen( 8, 36, 15, 53, BLU_CYH, 1, 3 );twTitle( "Win 6",, "T", "C" )
twCenter( 2, "Watch me go!" );twInkeyWait( 2 )
twSlide( "L", 30 );twSlide( "D", 7 );twSlide( "R", 50 );twSlide( "U", 13 )
twSlide( "L", 5 );twSlide( "D", 7 );twSlide( "L", 45 );twSlide( "D", 4 )
twSlide( "R", 20 );twSlide( "U", 10 );twSlide( "R", 8 );twSlide( "D", 13 )
twSlide( "U", 8 );twSlide( " L", 30 );twSlide( "D", 5 );twSlide( "R", 55 )
twSlide( "D", 3 );twSlide( "L", 15 );twSlide( "U", 10 );twSlide( "L", 15 )
twSlide( "D", 8 ); twSlide( "U", 10 )
twCenter( 4, "How's That!" )
twInkeyWait( 1 )
IF nMainChoice != nMenuLen
twClear( .F., " " );twCenter( 2, "Now, Try" );twCenter( 3, "Yourself" )
twCenter( 4, "with the" );twCenter( 5, "Cursor Keys!" )
SET KEY 5 TO Wup;SET KEY 24 TO Wdn;SET KEY 19 TO Wlt;SET KEY 4 TO Wrt
SET KEY 1 TO Uplt;SET KEY 18 TO Uprt;SET KEY 6 TO Dnlt;SET KEY 3 TO Dnrt
twInkeyWait( 60 )
SET KEY 5 to;SET KEY 24 to;SET KEY 19 to;SET KEY 4 to
SET KEY 1 to;SET KEY 18 to;SET KEY 6 to;SET KEY 3 to
ENDIF
twPop()
twOpen( 3, 3, 21, 75, CYH_RED, 3, 3 )
twTitle( "Window Sizing 1",, "T", "C" )
FOR nX = 1 TO 15
twCenter( nX + 1, PADL( ALLTRIM( STR( nX )), 2, "0" ) +;
"This is a test of the window re-sizing routine: Line " +;
PADL( ALLTRIM( STR( nX )), 2, "0" ))
NEXT
twTitle( "Watch us Resize this Window!",, "B", "L" )
twInkeyWait( 1 )
twSize( "H", -50 );twSize( "V", -10 );twSize( "H", 30 );twSize( "V", 7 )
twInkeyWait( 1 )
twPop()
nHandle := _twHandle( nMainWin )
twLeft( 20, " ACTIVE KEYS ", WHH_VIH )
twLeft( 21, " Up, Dn, Lt, Rt to Move Window ", BLA_CYH )
twLeft( 22, " PgUp, PgDn, Home, End to Size ", BLA_CYH )
twLeft( 23, " ESC to Exit ", BLA_CYH )
twInkeyWait( 1 )
_twHandle( nHandle )
nWin6 := twOpen( 3, 13, 20, 35, BLU_CYN, 7, 7 )
twTitle( "Window Sizing 2",, "T", "C" )
twTitle( "Left",, "B", "L" )
FOR nX = 1 TO 14
twCenter( nX + 1, "This is a test" + STRINT( nX ))
NEXT
IF nMainChoice != nMenuLen
SET KEY K_PGDN TO vplus;SET KEY K_PGUP TO vminus
SET KEY K_END TO hplus;SET KEY K_HOME TO hminus
SET KEY K_UP TO Wup;SET KEY K_DOWN TO Wdn
SET KEY K_LEFT TO Wlt;SET KEY K_RIGHT TO Wrt
DO WHILE .T.
twInkeyWait( 60 )
IF LASTKEY() == 27
twPop()
EXIT
ENDIF
ENDDO
SET KEY K_PGDN TO;SET KEY K_PGUP TO;SET KEY K_END TO;SET KEY K_HOME TO
SET KEY K_UP TO;SET KEY K_DOWN TO;SET KEY K_LEFT TO;SET KEY K_RIGHT TO
ELSE
Inkey( 1 ); FOR nX = 1 TO 6; vminus(); NEXT
Inkey( 1 ); FOR nX = 1 TO 6; hminus(); NEXT
Inkey( 1 ); FOR nX = 1 TO 6; wlt(); NEXT
Inkey( 1 ); FOR nX = 1 TO 3; wup(); NEXT
Inkey( 1 ); FOR nX = 1 TO 6; vplus(); NEXT
Inkey( 1 ); FOR nX = 1 TO 6; hplus(); NEXT
INKEY( 1 );twPop()
ENDIF
FOR nX = 1 TO 5
twPop()
NEXT
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc13()
//
// Purpose: Demonstrate twARPick and twDBPick
//
//----- Documented: 06-15-91 at 09:57:51pm --------------------------
PROCEDURE wProc13()
LOCAL MaCode, pColor, Ret_Val, x, r, c, GetList := {}
LOCAL GetTry1, GetTry2, OneCheck := .T.
twOpen( FULLSCREEN, WHH_BLU, 5, 9 )
twTitle( "User Definable Picklists",, "T", "C" )
twInkeyWait( 1 )
IF nMainChoice == nMenuLen
twCenter( 1, "This Module Requires User Input.", YEL_BLU )
Inkey( 2 )
ENDIF
twCenter( 2, "Watch how we get a picklist in a", CYH_BLU )
twCenter( 4, "CLIPPER WHEN condition.", CYH_BLU )
twInkeyWait( 1 )
twLeft( 16, " Alpha to Search" )
twLeft( 17, " Cursor keys Move Bar" )
twLeft( 18, " ALT U, J, N, H Move Box" )
twInkeyWait( 1 )
USE windemo INDEX windemo.ntx ALIAS codes NEW
SELECT codes
GetTry1 := SPACE( LEN( codes->codeshort ))
GetTry2 := SPACE( LEN( codes->codeshort ))
@ twRow( 10 ), twCol( 10 ) SAY "Getting.." GET GetTry1 PICTURE "@X" WHEN ;
CheckList( "codes", "codeshort", "Code;Description" )
@ twRow( 12 ), twCol( 10 ) SAY "Next One " GET GetTry2 PICTURE "@X" WHEN ;
CheckList( "codes", "codeshort", "Code Description" )
twInkeyWait( 1 )
twReadModal( GetList )
GetList := {}
twInkeyWait( 1 )
twCenter( 6, "An array may be processed in the same way.", CYH_BLU )
twInkeyWait( 1 )
MaCode := {}
pColor := { WHH_CYN, YEL_RED, BLA_WHI, YEL_RED, YEL_RED, YEL_CYN }
Ret_Val := 0
twLeft( 19, " SPACE to Tag/Untag" )
twLeft( 20, " F7 Tag All" )
twLeft( 21, " F8 Untag All" )
twLeft( 22, " F9 Swap Tagged/Untagged" )
//**************
// Fill Array
//**************
DBEVAL( { || AADD( MaCode, codes->codekey + "│" + codes->codeshort )} )
//***************
// Call Function
//***************
Ret_Val := twARPick( MaCode, "Code", ;
5, 25, pColor, 3, 6,, LEN( MaCode ), 1 )
IF LASTKEY() != 27
x := 0; r := 1
//*******************************
// Process Return from twARPick()
//*******************************
twOpen( 8, 10, 20, 50, GNH_VIO, 5, 9 )
twTitle( "Selections",, "T", "C" )
FOR x = 1 TO LEN( MaCode )
IF "√" $ MaCode[x]
OneCheck := .F.
@ twRow( r ), twCol( 2 ) SAY SUBSTR( MaCode[x], 1, LEN( MaCode[x] ) - 1 )
r++
IF r > 10
r := 1
@ ROW() + 1, twCol( 3 ) SAY "Press a key for more."
twInkeyWait( 10 )
twClear( .F., " " )
ENDIF
ENDIF
NEXT
IF OneCheck .AND. Ret_Val != 0
@ twRow( r + 1 ), twCol( 2 ) SAY "You Picked only One:"
@ twRow( r + 3 ), twCol( 2 ) SAY maCode[ Ret_Val ]
ENDIF
twInkeyWait( 2 )
twPop()
ENDIF
twPop()
CLOSE DATA
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc14()
//
// Purpose: Instance Variables Demo
//
//----- Documented: 06-15-91 at 09:58:04pm --------------------------
PROCEDURE wProc14()
LOCAL nKey := 0
twOpen( FULLSCREEN, MAINRED, 5, 9, "+" )
twTitle( "Window Class Instance Variables",, "T", "C" )
twCenter( 22, PADC( "Press 1, 2, 3 or 4 to View Instance Variables", 70 ), CYH_RED )
twCenter( 23, PADC( "For Windows 1 to 4 : ESC When Done.", 70 ), CYH_RED )
KEYBOARD CHR( 32 ) + CHR( 32 ) + CHR( 32 ) + CHR( 32 )
FourWin()
IF nMainChoice != nMenuLen
DO WHILE nKey != 27
nKey:=twInkeyWait( 0 )
IF nKey == 27
EXIT
ENDIF
IF ( nKey >= 49 ) .AND. ( nKey <= 52 )
IF nKey == 49
twActivate( nWin1 )
ELSEIF nKey == 50
twActivate( nWin2 )
ELSEIF nKey == 51
twActivate( nWin3 )
ELSEIF nKey == 52
twActivate( nWin4 )
ENDIF
twInkeyWait( 1 )
nKey := ChkInst()
IF ( nKey >= 49 ) .AND. ( nKey <= 52 )
KEYBOARD CHR( nKey )
ENDIF
ENDIF
ENDDO
ELSE
Inkey( 1 ); twActivate( nWin1 ); Inkey( 1 ); ChkInst()
Inkey( 1 ); twActivate( nWin3 ); Inkey( 1 ); ChkInst()
Inkey( 1 ); twActivate( nWin2 ); Inkey( 1 ); ChkInst()
Inkey( 1 ); twActivate( nWin4 ); Inkey( 1 ); ChkInst()
ENDIF
FOR nX = 1 to 5
twPop()
NEXT
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc15()
//
// Purpose: Display the Quick Reference .DOC File
//
//----- Documented: 06-15-91 at 09:58:16pm --------------------------
PROCEDURE wProc15()
LOCAL f
IF nMainChoice = nMenuLen
KEYBOARD REPL( CHR( 24 ), 25 ) + REPL( CHR( 19 ), 5 )+CHR( 27 )
ENDIF
twTextFile( FULLSCREEN, "TSWINQRF.DOC", MAINBLU, ;
0, 9, YEL_BLU, "TSDWIN Quick Reference" )
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE wProc16()
//
// Purpose: Demonstrate messages and alerts and other classes
//
//----- Documented: 06-15-91 at 09:58:28pm --------------------------
PROCEDURE wProc16()
LOCAL lExit := .F., nGetExit
LOCAL aActionKeys := {{ 1, { || BStuff01() }},;
{ 2, { || BStuff02() }},;
{ 3, { || BStuff03() }},;
{ 4, { || BStuff04() }},;
{ 5, { || BStuff05() }},;
{ 6, { || BStuff06() }},;
{ 7, { || BStuff07() }},;
{ 8, { || BStuff08() }}}
twExplode( .T. )
//------------------------------------------------------------------------
// Open BIG Stuff Display Window
//------------------------------------------------------------------------
twOpen( FULLSCREEN, BLU_YLH, 5, 10, "∙" )
twExplode( .F. )
twTitle( "TSDWIN Big Stuff", BLU_WHI, "T", "C" )
DO WHILE !lExit
twButtonBox( "V", ;
"Welcome to the TSDWIN BIG Stuff Demonstration. "+ ;
"The functions shown here are available but NOT "+ ;
"linked unless you need them. "+ ;
"With TSDWIN.LIB looking after the details, you get "+ ;
"more time to look after the important part of "+ ;
"your application... The Data!", ;
"This is a twButtonBox() Menu",, ;
{ "Alert Functions", ;
"Message Functions", ;
"Area Message Functions", ;
"DBF and Array Browsers", ;
"Indexing", ;
"Calculator", ;
"Calendar", ;
"Hardware Stuff", ;
"Main Menu" },, ;
2, 15, 22, 65, 3, 8,, aActionKeys )
nGetExit := twButtonBox( "H", ;
"Second Chance????", ;
"Exit BIG Stuff",, ;
{ "Continue", ;
"Main Menu" },, ;
8, 15, 14, 65, 3, 8 )
IF nGetExit = 2
lExit := .T.
ENDIF
ENDDO
twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE BStuff01()
//
// Purpose: Alert Functions
//
//----- Documented: 09-29-91 at 11:36:12am --------------------------
PROCEDURE BStuff01()
LOCAL RetVal, cClrTemp
LOCAL aActionKeys := { { 1, { || Action1(), __keyboard() }}, ;
{ 2, { || Action2(), __keyboard() }}, ;
{ 3, { || Action3(), __keyboard() }}, ;
{ 4, { || Action4(), __keyboard() }}}
LOCAL AText1 := ;
"One function is used in TSDWIN to create various types of " + ;
"alert boxes: PushButton Boxes, Radio Boxes and Select Boxes. " + ;
"Default buttons are created of none are passed, or, if passed " + ;
"as an array, buttons are created and displayed. In the case of " + ;
"PushButtons, they are shadowed with a thin shadow of the same " + ;
"type as the controlling window. The frame type is the same as " + ;
"that of the controlling window. The colour for each type of box " + ;
"defaults to an initial value, but is defineable. Shadow and frame " + ;
"type are defineable with each function call. The Buttons, or other " + ;
"select devices may be positioned horizontally or vertically."
LOCAL ATEXT2 := ;
"The return values are, for twButtonBox() and twRadioBox(), the element " + ;
"of the array in which the buttons are held. For twCheckBox(), an array " + ;
"of checked elements is returned. All three of these functions act " + ;
"like similar constructs in MS-Windows. For the twButtonBox() function, " + ;
"the default Exit key is the Enter or Escape key. For twCheckBox() and " + ;
"twRadioBox(), Enter or Space toggles the selection and the Escape key " + ;
"exits the routine. Only SINGLE choices are allowed with twButtonBox() " + ;
"and twRadioBox(). Multiple choices are allowed with twCheckBox(). " + ;
"You may pass either new Exit keys or additonal " + ;
"Action keys to the function. With this feature, you may use any one " + ;
"of these functions to present a pop-up menu with very little " + ;
"code. The menu choice can then be simply the function itself. With " + ;
"Action keys, you can extend the usefulness of these functions in any " + ;
"number of ways. More examples will be available on the TSD support " + ;
"board."
LOCAL AText3 := ;
"Watch while we demonstrate the same functions called with a vertical " + ;
"configuration. Remember, all that need be passed is the message text " + ;
"and an array of choices! We'll show the RETURN values with another " + ;
"TSDWIN Messaging function twInfo(), after you make a selection."
twExplode( .T. )
twOpen( FULLSCREEN, RED_CYN, 5, 4 )
twExplode( .F. )
twTitle( "TSDWIN Alert Functions",, "T", "C" )
CLEAR TYPEAHEAD
twInkeyWait( 2 )
twCenter( 02, "Our Alert Box Functions are Completely", RED_CYN )
twCenter( 03, "Flexible and May be Made to Conform to a Global Window", RED_CYN )
twCenter( 04, "Design you Already Use.", RED_CYN )
twInkeyWait( 4 )
twCenter( 06, "ALERT Function Descriptions", YEL_CYN )
twInkeyWait( 2 )
twSay( 8, 14, "twButtonBox() - Display a message. Create and display an array", BLA_CYN )
twSay( 9, 14, " of Shadowed PushButtons. Return Array Element.", BLA_CYN )
twInkeyWait( 2 )
twSay( 11, 14, "twRadioBox() - Display a message. Create and display an array", BLA_CYN )
twSay( 12, 14, " of Radio Selections. Return Array Element.", BLA_CYN )
twInkeyWait( 2 )
twSay( 14, 14, "twCheckBox() - Display a message. Create and display an array", BLA_CYN )
twSay( 15, 14, " of Select Boxes. Multiple choices allowed. This", BLA_CYN )
twSay( 16, 14, " function returns an array of choices.", BLA_CYN )
twInkeyWait( 2 )
twCenter( 19, "Colours for the above may be changed on the fly.", BLA_CYN )
twCenter( 20, "Frame and shadow type default to those for the current window.", BLA_CYN )
twInkeyWait( 2 )
twCenter( 22, " Press a Key or Wait!! ", GRN_YLH )
twInkeyWait( 10 )
twButtonBox( "H", AText1, "twButtonBox() with Defaults", 3 )
CLEAR TYPEAHEAD
twCheckBox( "H", ; // Style
AText1, ; // Message
"twCheckBox() with Custom Features",, ; // Title ( No Button Number )
{ "Check", "As", "Many", ; // Button
"As", "You", "Want" }, ; // Array
2, 3, 5, 18, 74, 3, 6 ) // Start, Coords, Shadow, Frame
CLEAR TYPEAHEAD
twRadioBox( "H", ; // Style
AText2, ; // Message
"This Uses twRadioBox()",, ; // Title ( No Button Number )
{ "What's On", "The Radio", ; // Button
"Tonight", "Dear" }, ; // Array
3, 2, 3, 21, 76, 7, 6 ) // Start, Coords, Shadow, Frame
CLEAR TYPEAHEAD
RetVal := twCheckBox( "V", ;
AText3, ;
"Here's twCheckBox() Vertical",, ;
{ "Who Says", "You Can", "Only Pick", "One??" }, ;
1,, 7,, 71, 1, 6 )
CheckRtn( RetVal )
CLEAR TYPEAHEAD
RetVal := twRadioBox( "V", ;
AText3, ;
"I Know Why These are Called Radio Boxes!",, ;
{ "WKRP", "CHFI", "WNYC", "CKFM", "C100", "TSDL" }, ;
5, 2, 5, 16, 54, 1, 6 )
CheckRtn( RetVal )
CLEAR TYPEAHEAD
RetVal := twButtonBox( "V", ;
AText3 + " Have a look at the DEMO to see how easy " + ;
"it is to do things like this!", ;
"LISTEN HERE!",, ;
{"Well Now", ;
"It's About Time", ;
"We Got", ;
"A Few Things Straight, Dont' You?", ;
"TSDWIN Can", ;
"Make Your Life Easier", ;
"And Your Applications", ;
"More Coherent", ;
"Have No Doubt About That" }, ;
5, 2, 6, 22, 72, 7, 6 )
CheckRtn( RetVal )
CLEAR TYPEAHEAD
RetVal := twButtonBox( "V", ;
"We'll Use a twButtonBox to demonstrate the other " + ;
"messaging functions in TSDWIN. In this demo we " + ;
"are using Action keys passed as code blocks to the " + ;
"twButtonBox() function. Action keys allow you to make " + ;
"a menu choice perform a task instead of returning " + ;
"an Exit key.", ;
"Displaying Messages",, ;
{ "twInfo()", "twWarn()", "twInquire()", "twTextMsg()", "Exit" }, ;
1,, 10, 15,, 1, 6,, aActionKeys )
cClrTemp := twAlertInit( 1, IIF( ! lMono, "gr+/rb, gr+/bg,,, gr+/b", "w+/n, n/w,,, w/n" ))
CLEAR TYPEAHEAD
twButtonBox( "H", "Now, wasn't that fun? You have seen some of the best Clipper functions"+;
" ever made. There will be more on the way, including Mouse Support. "+;
" TSD Ltd. will also be the first to provide Clipper users with a pseudo-object which turns lead into"+;
" gold, with the correct parameters! The parameter list will be supplied on"+;
" registration. One of the parameters will trigger a previously undocumented DOS"+;
" interrupt which starts a process rolling which will ultimately set the lead into gold routine into motion."+;
" After a suitable processing time, thin sheets of pure gold will start issuing"+;
" from the access door of the floppy drive designated as 'A' on your machine. "+;
" TSD recommends you advise your customers to have Brinks on hand when using this function."+;
" Please be warned that this particular routine may fail with some combinations of hardware."+;
" This routine has been tested on some types of hardware."+;
" Consult your hardware dealer for details about your BIOS if it doesn't work for you...", "GOLD! GOLD!! GOLD!!!", ;
1,,, 2, 5, 22, 75, 1, 4 )
twAlertInit( 1, cClrTemp )
twPop()
CLEAR TYPEAHEAD
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE BStuff02()
//
// Purpose: Messages
//
//----- Documented: 09-29-91 at 11:56:23am --------------------------
PROCEDURE BStuff02()
LOCAL amArray := {"Yes","No","Maybe"}, nMenuChoice
LOCAL sType := 3, fType := 9, Var2Read := SPACE( 20 ), Var2 := SPACE( 20 )
twExplode( .T. )
twOpen( FULLSCREEN, MAINBLU, 5, 4 )
twExplode( .F. )
twTitle( "TSDWIN Message Functions",, "T", "C" )
CLEAR TYPEAHEAD
twInkeyWait( 2 )
twCenter( 02, "Our PopUp Message Functions are Completely", YEL_BLU )
twCenter( 03, "Flexible and May be Made to Conform to a Global Window", YEL_BLU )
twCenter( 04, "Design you Already Use. These functions use MOST of the", YEL_BLU )
twCenter( 05, "attributes of the WINDOW Class.", YEL_BLU )
twInkeyWait( 4 )
twCenter( 07, "MESSAGE Function Descriptions", WHH_BLU )
twInkeyWait( 2 )
twSay( 09, 16, "twTextMsg() - Wraps text in a Pop Up box. ", BLA_YLH )
twInkeyWait( 2 )
twSay( 11, 16, "twWarn() - Post a Pop Up Warning Message. ", BLA_YLH )
twInkeyWait( 2 )
twSay( 13, 16, "twInfo() - Pop Up Informative Message. ", BLA_YLH )
twInkeyWait( 2 )
twSay( 15, 16, "twInquire() - Kind of Like a SAY/GET in a box. ", BLA_YLH )
twInkeyWait( 2 )
twSay( 17, 16, "twPopMenu() - Kind of Like a MENU TO in a box. ", BLA_YLH )
twInkeyWait( 2 )
twSay( 19, 16, "twPopChoice() - Kind of Like a ACHOICE in a box. ", BLA_YLH )
twInkeyWait( 2 )
twCenter( 21, "Colours for the above may be changed on the fly.", YEL_BLU )
twCenter( 22, "Frame and shadow type default to those for the current window.", YEL_BLU )
twInkeyWait( 2 )
twCenter( 23, " Press a Key or Wait!! ", GRN_YLH )
twInkeyWait( 10 )
twWarn( " Trying a Warning Message ",,,,, sType, fType )
twInfo( " Trying an Info Message ",,,,, sType, fType )
twTextMsg("Trying a Text Message. With this one we have to have the thing do a word"+;
"wrap to put it into the box.",,,5,5,15,45,, sType, fType )
twInquire( {"Trying out an Inquire Message:",;
"Let's see if more lines will work out OK too?",;
"3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13",;
"";
},, Var2Read,,, sType, fType )
twInquire( "Trying out another Inquire Message:","Trying", Var2 )
twInfo( {" Trying an Info Message ",;
"Item 1",;
"Item 2",;
"Item 3",;
"Item 4",;
"Item 5",;
"Item 6",;
"Item 7",;
"Item 8",;
"Item 9",;
"Item 10",;
"Item 11",;
"Item 12";
};
,,,,, sType, fType )
twMsgInit( 1, "gr+/r,w/n,,,w+/n" )
twInfo( {" Trying an Info Message ",;
"Item 1",;
"Item 2",;
"Item 3",;
"Item 4",;
"Item 5",;
"Item 6",;
"Item 7";
};
,,,,, sType, fType )
CLEAR TYPEAHEAD
amArray := {"Modify","Save","Abandon"}
//twPopMenu( amArray, cHeader, aMsg, wT, wL, nChoice, wColor, ;
// wsType, wfType, wFColor, wTColor, nRowSkip )
nMenuChoice := twPopMenu( amArray, "Select",, 5, 10, 2, ;
MAINBLU, 3, 5,, 2 )
twInfo( "You Chose: " + STRINT( nMenuChoice ))
twInkeyWait( 3 )
CLEAR TYPEAHEAD
amArray := {"Making PopUp Menus is","Really Easy","With TSDWIN"}
nMenuChoice := twPopMenu( amArray, "twPopMenu()",,,, 2, MAINBLU, 3, 5,, 2 )
twInfo("You Chose: " + STRINT( nMenuChoice ) )
AADD( amArray, "Trash" )
AADD( amArray, "Hide Under the Rug" )
twInkeyWait(0)
CLEAR TYPEAHEAD
nMenuChoice := twPopChoice( amArray, "twPopChoice()",,,,, 9, 9 )
twInfo("You Chose: " + STRINT( nMenuChoice ) )
twInkeyWait( 3 )
twPop()
CLEAR TYPEAHEAD
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE BStuff03()
//
// Purpose: Area Message Functions
//
//----- Documented: 09-29-91 at 12:03:31pm --------------------------
PROCEDURE BStuff03()
twExplode( .T. )
twOpen( FULLSCREEN, YEL_GRN, 5, 4 )
twExplode( .F. )
twTitle( "TSDWIN Area Message Functions",, "T", "C" )
CLEAR TYPEAHEAD
twInkeyWait( 2 )
twCenter( 02, "Our Area Message Functions are Completely", YEL_GRN )
twCenter( 03, "Flexible and May be Made to Conform to a user-defineable", YEL_GRN )
twCenter( 04, "colour and placement schemes.", YEL_GRN )
twInkeyWait( 4 )
twCenter( 06, "AREA MESSAGE Function Descriptions", YEL_CYN )
twInkeyWait( 2 )
twSay( 08, 16, "twWarnLine() - Post a Warning Message in Message Area. ", BLA_YLH )
twInkeyWait( 2 )
twSay( 10, 16, "twInfoLine() - Informative Message in Message Area. ", BLA_YLH )
twInkeyWait( 2 )
twSay( 14, 16, "These functions can be made to operate in a number ", BLA_YLH )
twSay( 15, 16, "of different ways! ", BLA_YLH )
twInkeyWait( 2 )
twCenter( 22, " Press a Key or Wait!! ", GRN_YLH )
twInkeyWait( 10 )
twInfoLine( 5, "twInfoLine() Puts Messages in a Pre-Defined Area. ( Any Key )" , "L" )
twInfoLine( 5, "You Pick the Justification ( Any Key )" , "C" )
twInfoLine( 5, "You can also Change the Area! ( Any Key )" , "R", 12 )
twInfoLine( 5, "You can have «TWO» Colour Attributes too! ( «Any Key» )" , "P" )
twWarnLine( 5, "twWarnLine() is the same «EXCEPT» for the default colour." , "P" )
BEEPER
twInkeyWait( 3 )
twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE BStuff04()
//
// Purpose: Browsers
//
//----- Documented: 09-29-91 at 12:07:10pm --------------------------
PROCEDURE BStuff04()
LOCAL TopBlock, BotBlock, ScopeBlock
LOCAL wT := 3, wL := 5, wB := 20, wR := 74
LOCAL wColor := IIF( ! lMono, "w+/rb,b/w,,gr+/rb,bg+/b", "w+/n,n/w,,n/w,w/n" )
LOCAL sType := 3, fType := 4, Editflag := .T.
LOCAL wfColor := IIF( ! lMono, "gr+/rb", "w+/n" )
LOCAL columns := NIL, aActionKeys := NIL, Footers := NIL
LOCAL ColHead := ""
LOCAL tArray :={}, f
FIELD codekey, codeshort, continent
twExplode( .T. )
twOpen( FULLSCREEN, YEL_GRN, 5, 4 )
twExplode( .F. )
twTitle( "TSDWIN DBF and Array Browsers",, "T", "C" )
CLEAR TYPEAHEAD
twInkeyWait( 2 )
twCenter( 02, "Our Browse Functions are designed to allow the programmer", YEL_GRN )
twCenter( 03, "all the possibilties allowed in the TBrowse system, but", YEL_GRN )
twCenter( 04, "without the pain. You can also pass executable code into", YEL_GRN )
twCenter( 05, "the browse.", YEL_GRN )
twInkeyWait( 4 )
twCenter( 07, "DBF and Array Browser Decsriptions", YEL_CYN )
twInkeyWait( 2 )
twSay( 09, 16, "twDBrowse() - Construct and operate a batabase browse. ", BLA_YLH )
twInkeyWait( 2 )
twSay( 11, 16, "twArBrowse() - Construct and operate an array browse. ", BLA_YLH )
twInkeyWait( 2 )
twSay( 13, 16, "Both functions have ancillary support functions to get", BLA_YLH )
twSay( 14, 16, "references to the browse object. Calls to twDBrowse() ", BLA_YLH )
twSay( 15, 16, "can be nested. ", BLA_YLH )
twInkeyWait( 2 )
twCenter( 22, " Press a Key or Wait!! ", GRN_YLH )
twInkeyWait( 10 )
USE windemo INDEX windemo ALIAS Windemo NEW
TopBlock := {|| codekey = "B" }
BotBlock := {|| codekey = "P" }
ScopeBlock := {|| codekey >= "B" .AND. codekey <= "P" }
// position record pointer within scope
GO TOP
SEEK "B"
columns := {}
AADD( Columns, TBColumnNew( "Code;Key", FIELDBLOCK( "codekey" ) ))
AADD( Columns, TBColumnNew( "Code;Description", FIELDBLOCK( "codeshort" ) ))
twInfoLine( -2, "A «Scoped» DBF Browse ( Between B and P ) - «F1» for Help «ALPHA» Search", "P" )
twDBrowse( wT, wL, wB, wR, columns, "Scoped Browse", footers, TopBlock, BotBlock, ;
ScopeBlock, EditFlag, aActionKeys, wColor, 3, 2, wFcolor, ;
.T., .T., .T. )
twAMPop()
Columns := NIL
TopBlock := NIL
BotBlock := NIL
ScopeBlock := NIL
twInfoLine( -2, "A «Full» DBF Browse - «F1» for Help «ALPHA» Search", "P" )
twDBrowse( 0, 0, MAXROW() - 1, MAXCOL(), columns, "Full Browse", footers, TopBlock, ;
BotBlock, ScopeBlock, EditFlag, aActionKeys, wColor, 3, 4, ;
wFcolor , .T., .T., .T., 2 )
twAMPop()
tArray := {}
DBEVAL( {|| AADD( tArray, Windemo->Codeshort + " │ " + Windemo->Continent )})
twInfoLine( -2, "An «Array» Browse with twArBrowse() - «F1» for Help «ALPHA» Search", "P" )
twArBrowse( wT, wL, wB, wR, tArray, "Array from a DBF",,,,, ;
MAINBRN, 3, 1 )
twAMPop()
tArray := DIRECTORY("*.*")
twInfoLine( -2, "A «Directory» with twArBrowse() - «F1» for Help «ALPHA» Search", "P" )
twArBrowse( wT, wL, wB, wR, tArray, "Directory of Files in " + CURDIR() ;
,{"File Name","Size","Date","Time","Attribute"},,,, MAINCYN, 3, 1 )
twAMPop()
twPop()
CLOSE DATA
CLEAR TYPEAHEAD
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE BStuff05()
//
// Purpose: Indexing
//
//----- Documented: 09-29-91 at 12:07:46pm --------------------------
PROCEDURE BStuff05()
LOCAL aNtxArray := {}
twExplode( .T. )
twOpen( FULLSCREEN, RED_CYN, 5, 4 )
twExplode( .F. )
twTitle( "TSDWIN twIndexMaker() Window Function",, "T", "C" )
CLEAR TYPEAHEAD
twInkeyWait( 2 )
twCenter( 02, "The TSDWIN Indexer makes use of the new GaugeBar Class.", RED_CYN )
twCenter( 03, "It gives your users what they want to see... what's", RED_CYN )
twCenter( 04, "going on... and frees you from the drudgery of creating", RED_CYN )
twCenter( 05, "needed but complex routines.", RED_CYN )
twInkeyWait( 4 )
twCenter( 07, "twIndexMaker Function Description", YEL_CYN )
twInkeyWait( 2 )
twSay( 09, 16, "Watch how these two lines of code operate:", BLA_YLH )
twSay( 11, 6, "AADD( aNtxArray, { 'Windemo', 'Windemo', 'C', 'UPPER( CodeKey )' }) ", BLA_YLH )
twSay( 13, 6, "twIndexMaker( aNtxArray,,,,, MAINBLU, 3, 4, ; ", BLA_YLH )
twSay( 14, 16, "'Handy Index Maker',, .F. ) ", BLA_YLH )
twInkeyWait( 2 )
twCenter( 22, " Press a Key or Wait!! ", GRN_YLH )
twInkeyWait( 10 )
AADD( aNtxArray, { "Windemo", "Windemo", "C", "UPPER( CodeKey )" } )
twIndexMaker( aNtxArray,,,,, MAINBRN, 3, 4, ;
"Handy Index Maker",, .F. )
twCenter( 16, "How was That??", RDH_YLH )
twInkeyWait( 3 )
twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE BStuff06()
//
// Purpose: Calculator
//
//----- Documented: 09-29-91 at 12:33:49pm --------------------------
PROCEDURE BStuff06()
LOCAL nKey, nGetTry := 0, GetList := {}
SETCOLOR( IIF( ! lMono, 'n/bg', 'w/n' ))
twExplode( .T. )
twOpen( ,,,,,,, '' )
twOpen( 5, 10, 19, 69, MAINBLU, 3, 4 )
twExplode( .F. )
twTitle( 'TSD twCalculator()', '', 'T', 'C' )
twTitle( 'Shift-F1 to Call Calculator', '', 'B', 'C' )
twCalcInit( 2, 3, MAINCLC, 3, 10, .T. )
SET KEY K_SH_F1 TO twCallCalc()
DO WHILE .T.
@ twRow( 4 ), twCol( 10 ) SAY "Get a Value" GET nGetTry PICTURE "##########.####"
twReadModal( GetList ); GetList := {}
IF LASTKEY() == K_ESC
EXIT
ENDIF
ENDDO
SET KEY K_SH_F1 TO
twPop(); twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE BStuff07()
//
// Purpose: Calendar
//
//----- Documented: 09-29-91 at 12:33:57pm --------------------------
PROCEDURE BStuff07()
LOCAL nKey, dGetTry := DATE(), GetList := {}
SETCOLOR( IIF( ! lMono, 'n/bg', 'w/n' ))
twExplode( .T. )
twOpen( ,,,,,,, '' )
twOpen( 5, 10, 19, 69, 'w/b, gr+/r,,, n/w', 3, 4 )
twExplode( .F. )
twTitle( 'TSD twCalendar()', '', 'T', 'C' )
twTitle( 'Shift-F1 to Call Calendar', '', 'B', 'C' )
twDateInit( 2, 3, MAINCLC, 3, 1, .T. )
SET KEY K_SH_F1 TO twCallDate()
DO WHILE .T.
@ twRow( 4 ), twCol( 10 ) SAY "Get a Value" GET dGetTry PICTURE "@D"
twReadModal( GetList ); GetList := {}
IF LASTKEY() == K_ESC
EXIT
ENDIF
ENDDO
twDateInit( 2, 3, MAINCYN, 7, 10, .F. )
SET KEY K_SH_F1 TO
DO WHILE .T.
@ twRow( 6 ), twCol( 10 ) SAY "Get a Value" GET dGetTry PICTURE "@D" WHEN twCalendar( @dGetTry )
twReadModal( GetList ); GetList := {}
IF LASTKEY() == K_ESC
EXIT
ENDIF
ENDDO
twPop(); twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE BStuff08()
//
// Purpose: Hardware Stuff
//
//----- Documented: 09-29-91 at 12:34:07pm --------------------------
PROCEDURE BStuff08()
LOCAL nKey := 0, aKeyTry := {}, nX := 0, nRow := 3
LOCAL cDrStat := "0", nDrive := 0, GetList := {}, RetVal
SETCOLOR( IIF( ! lMono, 'n/bg', 'w+/n' ))
twOpen()
twOpen( 2, 5, 21, 74, MAINBLU, 3, 4 )
twTitle( "Testing twIsDrive()" )
twTitle( "Get out a Diskette or Two!!!!!!!!!!!!!",, "B", "C" )
BEEPER
DO WHILE .T.
twSay( 2, 5, "Enter Drive to Check ( 0 for Drive A:, 1 for Drive B: )!" )
@ twRow( 4 ), twCol( 12 ) GET nDrive PICTURE "#"
twReadModal( GetList ); GetList := {}
IF LASTKEY() == K_ESC
EXIT
ENDIF
twIsDrive( nDrive, 3, 4 )
ENDDO
twPop()
twOpen( 2, 5, 21, 74, MAINBLU, 3, 4 )
twTitle( "Testing tw_GetKSt() - Try the Keys!!!", "n/w", "T", "C" )
AADD( aKeyTry, RSHIFT )
AADD( aKeyTry, LSHIFT )
AADD( aKeyTry, CTRL )
AADD( aKeyTry, ALT )
AADD( aKeyTry, SCROLLSTAT )
AADD( aKeyTry, NUMLOCKSTAT )
AADD( aKeyTry, CAPLOCKSTAT )
AADD( aKeyTry, INSERTSTAT )
AADD( aKeyTry, CTRLNUMLKSTAT )
AADD( aKeyTry, SCROLLOCK )
AADD( aKeyTry, NUMLOCK )
AADD( aKeyTry, CAPLOCK )
AADD( aKeyTry, INSERT )
twSay( nRow++, 15, " Right Shift:")
twSay( nRow++, 15, " Left Shift:")
twSay( nRow++, 15, " Control:")
twSay( nRow++, 15, " Alternate:")
twSay( nRow++, 15, " Scroll Lock Status:")
twSay( nRow++, 15, "Number Lock Status :")
twSay( nRow++, 15, " Caps Lock Status:")
twSay( nRow++, 15, " Insert Status:")
twSay( nRow++, 15, "Ctrl NumLock Status:")
twSay( nRow++, 15, " Scroll Lock Key:")
twSay( nRow++, 15, " Number Lock Key:")
twSay( nRow++, 15, " Caps Lock Key:")
twSay( nRow++, 15, " Insert Key:")
DO WHILE ( nkey := Inkey()) != 27
twTitle( "Counter" + STRINT( ++nX ), "", "B", "C" )
nRow := 3
twSay( nRow++, 35, STR( tw_GetKSt( RSHIFT )), IIF( tw_GetKSt( RSHIFT )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( LSHIFT )), IIF( tw_GetKSt( LSHIFT )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( CTRL )), IIF( tw_GetKSt( CTRL )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( ALT )), IIF( tw_GetKSt( ALT )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( SCROLLSTAT )), IIF( tw_GetKSt( SCROLLSTAT )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( NUMLOCKSTAT )), IIF( tw_GetKSt( NUMLOCKSTAT )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( CAPLOCKSTAT )), IIF( tw_GetKSt( CAPLOCKSTAT )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( INSERTSTAT )), IIF( tw_GetKSt( INSERTSTAT )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( CTRLNUMLKSTAT )), IIF( tw_GetKSt( CTRLNUMLKSTAT )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( SCROLLOCK )), IIF( tw_GetKSt( SCROLLOCK )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( NUMLOCK )), IIF( tw_GetKSt( NUMLOCK )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( CAPLOCK )), IIF( tw_GetKSt( CAPLOCK )= 0,"w/b","gr+/b"))
twSay( nRow++, 35, STR( tw_GetKSt( INSERT )), IIF( tw_GetKSt( INSERT )= 0,"w/b","gr+/b"))
ENDDO
twInkeyWait( 3 )
twPop();twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE PopaFew()
//
// Purpose: Display and Pop 20 Windows to Open
// the Demoonstration
//
//----- Documented: 06-15-91 at 09:58:41pm --------------------------
PROCEDURE PopaFew()
twOpen( 05, 10, 10, 67, RED_BLH, 1, 06 ) ; twInkeyWait( .2 )
twOpen( 08, 45, 22, 55, BLU_CYH, 3, 05, "▒" ); twInkeyWait( .2 )
twOpen( 15, 23, 20, 79, GRN_WHH, 7, 04, "." ); twInkeyWait( .2 )
twOpen( 02, 02, 12, 44, BLA_YLH, 9, 03, "░" ); twInkeyWait( .2 )
twOpen( 18, 05, 22, 75, CYH_RED, 5, 02, "▓" ); twInkeyWait( .2 )
twOpen( 11, 60, 17, 77, BLU_YLH, 3, 01, "█" ); twInkeyWait( .2 )
twOpen( 09, 34, 18, 57, WHH_BLU, 7, 07, "" ); twInkeyWait( .2 )
twOpen( 03, 50, 09, 70, BLA_GNH, 1, 08, "" ); twInkeyWait( .2 )
twOpen( 12, 03, 17, 57, WHH_VIH, 9, 09, "" ); twInkeyWait( .2 )
twOpen( 18, 14, 21, 38, YEL_VIO, 7, 10, "" ); twInkeyWait( .2 )
twOpen( 05, 48, 17, 67, GRH_BAH, 1, 11, "" ); twInkeyWait( .2 )
twOpen( 01, 70, 18, 76, WHI_BRN, 9, 12, "" ); twInkeyWait( .2 )
twOpen( 02, 34, 17, 42, BLH_RED, 3, 13, "" ); twInkeyWait( .2 )
twOpen( 03, 06, 09, 18, REH_BLH, 1, 14, "" ); twInkeyWait( .2 )
twOpen( 10, 20, 13, 50, WHH_RDH, 1, 06, "0" )
//*********************************************************************
// There is sometimes a problem with ';' in Clipper 5.01
//*********************************************************************
twInkeyWait( .2 )
twOpen( 08, 12, 20, 39, BLH_YLH, 3, 05, "" ); twInkeyWait( .2 )
twOpen( 01, 45, 07, 69, BLH_WHH, 9, 08, "*" ); twInkeyWait( .2 )
twOpen( 14, 71, 22, 77, BLA_BLH, 7, 07, "" ); twInkeyWait( .2 )
twOpen( 04, 30, 11, 47, VIO_GNH, 3, 10, "" ); twInkeyWait( .2 )
twOpen( 18, 09, 20, 73, BLU_CYH, 1, 04, "" )
twCenter( 1, " Trilateral Systems Development Ltd. ", RDH_CYH, )
twInkeyWait( .2 )
twOpen( 07, 51, 15, 68, WHH_BLH, 1, 08 ); twInkeyWait( 1 )
twCenter( 3, "Let's" ); twCenter( 4, "Pop 'Em" ); twInkeyWait( .5 )
SETBLINK( .T. ); twInkeyWait( 2 )
IF ! lMono
SETBLINK( .F. )
ENDIF
FOR nX = 1 TO 21
twPop(); twInkeyWait( .1 )
NEXT
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE SignOff()
//
// Purpose: End of Demonstration Display
//
//----- Documented: 06-15-91 at 09:58:52pm --------------------------
PROCEDURE SignOff()
LOCAL f, nWin1
IF ! lMono
SETBLINK( .F. )
ENDIF
//******************
// Thank You Screen
//******************
twOpen( 5, 5, 19, 74, CYH_RDH, 3, 10, "▒" )
twReplicate( 1, 1, "▀", 68, YEL_WHH )
twReplicate( 13, 1, "▄", 68, YEL_WHH )
twOpen( 9, 27, 14, 50, BLU_CYN, 3 )
twSay( 1, 4, "Trilateral" )
twSay( 1, 4, "T", RDH_CYN )
twSay( 2, 4, "Systems" )
twSay( 2, 4, "S", YEL_CYN )
twSay( 3, 4, "Development Ltd." )
twSay( 3, 4, "D", WHH_CYN )
twSay( 4, 4, "( 519 )-758-0867" )
twInkeyWait( 2 )
twSay( 00, 0, " says ", BLU_CYN )
twSay( 00, 9, "T", RDH_CYN )
twSay( 00, 10, "S", YEL_CYN )
twSay( 00, 11, "D", WHH_CYN )
twInkeyWait( 1 )
twSay( 01, 0, " Thank You for Watching ", YEL_RDH )
twInkeyWait( 1 )
twSay( 02, 0, " Registered Versions ", WHH_BLH )
twInkeyWait( 1 )
twSay( 03, 0, " Are Available ", BLA_YLH )
twInkeyWait( 1 )
twSay( 04, 0, " At Low Cost ", RDH_GNH )
twInkeyWait( 2 )
twSay( 05, 0, " ..Please Contact.. ", WHH_VIH )
twInkeyWait( 5 )
twPop()
twPop()
twClear( .F., "░" )
//************************
// Copyright Screen
//************************
twExplode( .T. )
nWin1 := twOpen( 0, 0, maxrow(), maxcol(), BLU_CYN, 5 )
twExplode( .F. )
twOpen( 16, 65, 22, 78, WHH_CYN )
twSay( 00, 0, " ▄▄▄▄▄▄▄▄▄▄▄▄▄ ", RDH_CYN )
twSay( 01, 0, " ▀ █ ▀ ", RDH_CYN )
twSay( 02, 0, " █ ", RDH_CYN )
twSay( 03, 0, " █ ", RDH_CYN )
twSay( 04, 0, " █ ", RDH_CYN )
twSay( 05, 0, " █ ", RDH_CYN )
twSay( 06, 0, " █ ", RDH_CYN )
twSay( 07, 0, " ▄█▄ ", RDH_CYN )
//inkey( 0 )
twSlide( "U", 13 )
twSlide( "L", 61 )
//inkey( 0 )
twOpen( 15, 64, 22, 77, WHH_CYN )
twSay( 00, 0, "▄▄▄▄▄▄▄▄▄▄▄▄▄▄", YEL_CYN )
twSay( 01, 0, "█ █", YEL_CYN )
twSay( 02, 0, "█ █", YEL_CYN )
twSay( 03, 0, "█ ", YEL_CYN )
twSay( 04, 0, "▀▀▀▀▀▀▀▀▀▀▀▀▀█", YEL_CYN )
twSay( 05, 0, " █", YEL_CYN )
twSay( 06, 0, "█ █", YEL_CYN )
twSay( 07, 0, "█ █", YEL_CYN )
twSay( 08, 0, "█▄▄▄▄▄▄▄▄▄▄▄▄█", YEL_CYN )
//inkey( 0 )
twSlide( "U", 7 )
twSlide( "L", 60 )
SETCOLOR( YEL_CYN )
//inkey( 0 )
@5 + 3, 4 say "▄▄▄▄▄▄▄█▄▄▄▄▄▄"
@6 + 3, 4 say "█ ▄█▄ █"
SETCOLOR( RDH_CYN )
@5 + 3, 11 say "█"
@6 + 3, 10 say "▄█▄"
//inkey( 0 )
twOpen( 16, 65, 22, 78, WHH_CYN )
twSay( 00, 0, " ▄▄▄▄▄▄▄▄▄▄ ", WHH_CYN )
twSay( 01, 0, " ██ █ ", WHH_CYN )
twSay( 02, 0, " ██ █ ", WHH_CYN )
twSay( 03, 0, " ██ █ ", WHH_CYN )
twSay( 04, 0, " ██ █ ", WHH_CYN )
twSay( 05, 0, " ██ █ ", WHH_CYN )
twSay( 06, 0, " ██▄▄▄▄▄▄▄█ ", WHH_CYN )
//inkey( 0 )
twSlide( "U", 02 )
twSlide( "L", 61 )
SETCOLOR( YEL_CYN )
//inkey( 0 )
@11 + 3, 4 say "█ ▄▄▄▄▄▄▄▄▄▄ █"
@12 + 3, 4 say "█▄██▄▄▄▄▄▄▄█▄█"
//inkey( 0 )
SETCOLOR( WHH_CYN )
@11 + 3, 6 say "▄▄▄▄▄▄▄▄▄▄"
//inkey( 0 )
@12 + 3, 6 say "██"
//inkey( 0 )
@12 + 3, 15 say "█"
//inkey( 0 )
_twHandle( nWin1 )
twSay( 15 + 3, 20, "█ █ ▀█▀ █▄▄▄" )
twSay( 16 + 3, 20, "█ █ █ █ █ █" )
twSay( 17 + 3, 20, "█▄█▄█ ▄█▄ █ █ CLIPPER 5.01 Windowing Library" )
twInkeyWait( .5 )
twCenter( 22, "VISA - MasterCard - American Express - Discover", GNH_CYN )
twCenter( 23, "Please specify diskette format!", YEL_CYN )
twHLine( 01, 21, 56, 1, BLH_CYN )
twSay( 02, 21, "TSDWIN.LIB v1.50 is a ShareWare Product. You are free to", RED_CYN )
twSay( 03, 21, "use it in order to judge its usefulness to you in your", RED_CYN )
twSay( 04, 21, " situation. If you like and continue to use TSDWIN, ", RED_CYN )
twSay( 05, 21, " please register one of these options:", RED_CYN )
twSay( 07, 29, "1. Register Your Version 1.50 $ 65.00 US" )
twSay( 09, 29, "2. Latest Version/Part Source $ 85.00 US" )
twSay( 11, 29, "3. Latest Version/Full Source $185.00 US" )
twSay( 13, 29, "All include your Disk Format with Manual" )
twSay( 14, 29, "and NG on disk. Support BBS membership." )
twSay( 15, 29, "See ORDERFRM.DOC for Details." )
twSay( 17, 36, "TSDWIN's customers are the most important", BLA_CYN )
twSay( 18, 36, " factor in its evolving design!", BLA_CYN )
twCalcInit( 2, 3, "gr+/gr, g+/n,,, r+/n", 3, 10 )
twDateInit( 2, 3, "gr+/gr, g+/n,,, r+/n", 3, 1, .F. )
SET KEY K_F2 TO twCallCalc()
SET KEY K_F3 TO twCallDate()
twInkeyWait( 3 )
twWarn( { "By the way, the CALCULATOR is active on F2 right now!!!", ;
" and the Calendar is on F3" }, "twCalculator()", 2,,, 3, 2 )
_twHandle( nWin1 )
twTitle( "Any Key",, "B", "C" )
twInkeyWait( 30 )
twSay( 17, 36, " ", BLA_CYN )
twSay( 18, 36, " Here's where you can place your order!", RED_CYN )
twInkeyWait( 3 )
twScroll( 15, .F., 1, 21, 17, 77 )
twInkeyWait( 1 )
twSay( 02, 21, " CANADA U.S.A. - Central/West " , RED_CYN )
twSay( 03, 21, " TSD Limited FOX Business Systems " , WHH_CYN )
twSay( 04, 21, " 18 Bond St. South 217 McCall Rd. " , BLA_CYN )
twSay( 05, 21, " Dundas, ON, Canada Manhattan, KS, 66502 " , BLA_CYN )
twSay( 06, 21, " L9H 3H1 Voice: 913-776-1452 " , BLA_CYN )
twSay( 07, 21, " Voice: 416-628-5086 BBS: 913-776-0111 " , BLA_CYN )
twSay( 08, 21, " BBS: 519-650-0389 " , BLA_CYN )
twSay( 10, 21, " U.S.A - East EUROPE " , RED_CYN )
twSay( 11, 21, " Ahlstedt Software Meisal SoftWare Production" , WHH_CYN )
twSay( 12, 21, " 2212 Wade Hampton Blvd. Torgvegen 17 " , BLA_CYN )
twSay( 13, 21, "Greenville, SC, 29615-2249 Kleppe, Norway, N4060 " , BLA_CYN )
twSay( 14, 21, " Voice: 803-292-2249 Voice: +474-425625 " , BLA_CYN )
twSay( 15, 21, " +474-627555 " , BLA_CYN )
twTitle( "Press a Key to End Demo",, "B", "C" )
twInkeyWait( 0 )
twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE Phones()
//
// Purpose: Scroll the possible phone numbers for dialing.
//
//----- Documented: 09-14-91 at 10:35:20pm --------------------------
PROCEDURE Phones()
LOCAL aPhones := { "1-416-628-5086 TSD Ltd. Brantford, ON, Canada ", ;
"1-913-776-1452 Fox Business Systems, Manhattan, KS, USA ", ;
"1-803-292-2249 Ahlstedt Software, Greenville, SC, USA ", ;
"011+474-627555 Meisal Software Production, Kleppe, Norway" }
LOCAL nNumber, GetList := {}
twOpen( FULLSCREEN, MAINBLU, 5, 10 )
twTitle( "You Can Register Now!", "n/w", "T", "C" )
twCenter( 2, "If you have a Hayes compatibles modem connected on COM1, " )
twCenter( 3, "Select a number to Dial and we will take your order!" )
twInkeyWait( 3 )
nNumber := twPopChoice( aPhones, "By the way, This is twPopChoice()",,,, MAINBRN, 3, 4 )
IF nNumber != 0
nNumber := LEFT( aPhones[ nNumber ], 16 )
twCenter( 5, "You may want to edit the number if it's not long distance!" )
@ twRow( 7 ), twCol( 25 ) SAY "Dial: " GET nNumber
SETCURSOR( 1 )
twReadModal( GetList ); GetList := {}
SETCURSOR( 0 )
IF LASTKEY() != K_ESC
tw_MdInit( 300 )
tw_MdStr( "M1L1" )
twCenter( 9, "Dialing: " + nNumber )
twSay2( 11, 14, "Press «SPACEBAR» after «CONNECT» or engaging your phone." )
Inkey( 1 )
tw_MdDial( nNumber )
tw_MdStr( "Z0" )
ENDIF
ENDIF
twPop()
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE Scroller()
//
// Purpose: Scroll Display in Activate Demonstration
//
//----- Documented: 06-15-91 at 09:59:04pm --------------------------
PROCEDURE Scroller()
nY := 1
DO WHILE nY <= 2
twSay( 1, 1, " Use Your Imagination ", YEL_RDH ); twInkeyWait( .1 )
twScroll( -1, .F. ); twInkeyWait( .1 )
twSay( 1, 1, " ** Have a Ball ** ", BLA_GNH ); twInkeyWait( .1 )
twScroll( -1, .F. ); twInkeyWait( .1 )
twSay( 1, 1, " CLIPPERING is a joy, ", WHH_BLH ); twInkeyWait( .1 )
twScroll( -1, .F. ); twInkeyWait( .1 )
twSay( 1, 1, " with TSD's Windows ", RDH_YLH ); twInkeyWait( .1 )
twScroll( -1, .F. ); twInkeyWait( .1 )
nY++
ENDDO
twSay( 1, 1, " **Happy Clippering** ", WHH_VIH )
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE FourWin()
//
// Purpose: Opens Four Windows
// That we use a few times
//
//----- Documented: 06-15-91 at 09:59:14pm --------------------------
PROCEDURE FourWin()
//_twExplode( .T. )
nWin1 := twOpen( 9, 4, 19, 27, CYH_GRN, 7, 7 )
twTitle( "I'm Happy!!",, "T", "C" ); twInkeyWait( 2 )
nWin2 := twOpen( 3, 34, 14, 72, GNH_VIO, 9, 9 )
twTitle( "I AM the Greatest",, "T", "C" ); twCenter( 2, "Here's One" )
twInkeyWait( 2 )
nWin3 := twOpen( 7, 12, 17, 49, ;
IIF( ! lMono, "r/*gr, w+/b,,, n/bg", "w+/n, n/w,,, w/n" ), 1, 2 )
twTitle( "I Shall Prevail",, "T", "C" ); twCenter( 2, "Here's Another" )
twInkeyWait( 2 )
nWin4 := twOpen( 12, 47, 20, 75, ;
IIF( ! lMono, "g/*w, gr+/r,,, n/w", "w+/n, n/w,,, w/n" ), 3, 4 )
twTitle( "Hard Rock",, "T", "C" ); twCenter( 2, "And Another" )
//_twExplode( .F. )
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE FournWin2()
//
// Purpose: Opens Four Windows
//
//----- Documented: 06-15-91 at 09:59:23pm --------------------------
PROCEDURE FournWin2()
//_twExplode( .T. )
nWin1 := twOpen( 8, 10, 18, 70, RDH_CYH, 1, 2 ); twTitle( "Win 1",, "T", "C" )
twCenter( 3, "First Window" ); twInkeyWait( 1 )
nWin2 := twOpen( 5, 5, 20, 45, YEL_RED, 3, 2 ); twTitle( "Win 2",, "T", "C" )
twCenter( 5, "Second Window" ); twInkeyWait( 1 )
nWin3 := twOpen( 12, 24, 16, 68, WHH_BLU, 7, 2 ); twTitle( "Win 3",, "T", " C" )
twCenter( 2, "Third Window" );twInkeyWait( 1 )
nWin4 := twOpen( 2, 49, 22, 63, YEL_GRN, 9, 2 ); twTitle( "Win 4",, "T", "C" )
twCenter( 6, "Fourth" ); twCenter( 7, "Window" )
//_twExplode( .F. )
twInkeyWait( 2 )
RETURN
//-------------------------------------------------------------------
// SET KEY Procedures for User Sliding
//-------------------------------------------------------------------
PROCEDURE Wup
twSlide( "U", 1 ); RETURN
PROCEDURE Wdn
twSlide( "D", 1 ); RETURN
PROCEDURE Wlt
twSlide( "L", 1 ); RETURN
PROCEDURE Wrt
twSlide( "R", 1 ); RETURN
PROCEDURE Uplt
twSlide( "U", 1 ); twSlide( "L", 2 )
RETURN
PROCEDURE Uprt
twSlide( "U", 1 ); twSlide( "R", 2 )
RETURN
PROCEDURE Dnlt
twSlide( "D", 1 ); twSlide( " L", 2 )
RETURN
PROCEDURE Dnrt
twSlide( "D", 1 ); twSlide( "R", 2 )
RETURN
//-------------------------------------------------------------------
// Set Key Procedures for Redisplay from Stack
//-------------------------------------------------------------------
PROCEDURE DnWin1()
twDisplay( nWin1 ); RETURN
PROCEDURE DnWin2()
twDisplay( nWin2 ); RETURN
PROCEDURE DnWin3()
twDisplay( nWin3 ); RETURN
PROCEDURE DnWin4()
twDisplay( nWin4 ); RETURN
//-------------------------------------------------------------------
// Set Key Procedures for Window Activation
//-------------------------------------------------------------------
PROCEDURE AnWin1()
STATIC num := 0
twActivate( nWin1 )
twCenter( 4, "Try#: " + PADL( STRINT( ++num ), 2 ))
RETURN
PROCEDURE AnWin2()
STATIC num := 0
twActivate( nWin2 )
twCenter( 4, "Try#: " + PADL( STRINT( ++num ), 2 ))
RETURN
PROCEDURE AnWin3()
STATIC num := 0
twActivate( nWin3 )
twCenter( 4, "Try#: " + PADL( STRINT( ++num ), 2 ))
RETURN
PROCEDURE AnWin4()
STATIC num := 0
twActivate( nWin4 )
twCenter( 4, "Try#: " + PADL( STRINT( ++num ), 2 ))
RETURN
//-------------------------------------------------------------------
// Set Key Procedures for Window Sizing
//-------------------------------------------------------------------
PROCEDURE vplus
twSize( "V", 1 ); RETURN
PROCEDURE vminus
twSize( "V", -1 ); RETURN
PROCEDURE hplus
twSize( "H", 1 ); RETURN
PROCEDURE hminus
twSize( "H", -1 ); RETURN
//------------------------------------------------------------------------
//
// FUNCTION CheckList( In_Alias, In_Field, ColHead )
//
// Parameters:
//
// Return:
//
// Purpose: Executes in the WHEN condition in twDBPick()
// Demonstration/
//
//----- Documented: 06-15-91 at 10:00:02pm -------------------------------
FUNCTION CheckList( In_Alias, In_Field, ColHead )
LOCAL bColor := IIF( ! lMono, "w+/g, gr+/br,,bg+/g n/w", ;
"w+/n, n/w,,,w/n, n/w" )
LOCAL SelField, TcRecord1 := RECNO()
LOCAL TcSelect := SELECT()
LOCAL TcRecord2, t, RetVal
t := twDBPick( In_Alias, In_Field, ColHead, 2, 45, bColor, 1, 9 )
IF LASTKEY() <> 27
SELECT &In_Alias; TcRecord2 := RECNO(); GOTO t
SelField := In_Alias + "->" + In_Field
KEYBOARD &SelField
GO TcRecord2
SELECT( TcSelect ); GO TcRecord1
RetVal := .T.
ELSEIF LASTKEY() == 3 // page down
RetVal := .T.
ELSE
RetVal := .F.
ENDIF
RETURN RetVal
//------------------------------------------------------------------------
//
// FUNCTION ChkInst()
//
// Parameters:
//
// Return:
//
// Purpose:
//
//----- Documented: 06-15-91 at 10:00:20pm -------------------------------
FUNCTION ChkInst()
LOCAL tScr, iHandle, iTop, iLeft, iBottom, iRight, iHidden
LOCAL cClrTemp, iColor, iShadow, iFrame, iFcolor, iCurrent
LOCAL isTop, isLeft, isBottom, isRight, iwLength, iwWidth
LOCAL nKey := 0
iHandle := STRINT( _twHandle())
iTop := STRINT( _twTop())
iLeft := STRINT( _twLeft())
iBottom := STRINT( _twBottom())
iRight := STRINT( _twRight())
isTop := STRINT( _twsTop())
isLeft := STRINT( _twsLeft())
isBottom := STRINT( _twsBottom())
isRight := STRINT( _twsRight())
iHidden := LEFT( _twHidden(), 25 )
iColor := _twColor()
iShadow := STRINT( _twShadow())
iFrame := STRINT( _twFrame())
iFcolor := _twFcolor()
iCurrent := LEFT( _twCurrent(), 25 )
iwLength := STRINT( VAL( iBottom ) - VAL( iTop ) + 1 )
iwWidth := STRINT( VAL( iRight ) - VAL( iLeft ) + 1 )
cClrTemp:=SETCOLOR( YEL_BLU )
tScr := SAVESCREEN( 0, 3, 19, 44 )
@ 00, 3 CLEAR TO 19, 44
@ 00, 3 TO 19, 44 DOUBLE
@ 00, 5 SAY "Instance Variables:"
@ 19, 5 SAY "Press a Key..."
@ 01, 5 SAY " _twHandle(): " + iHandle
@ 02, 5 SAY " _twTop(): " + iTop
@ 03, 5 SAY " _twLeft(): " + iLeft
@ 04, 5 SAY " _twBottom(): " + iBottom
@ 05, 5 SAY " _twRight(): " + iRight
@ 06, 5 SAY " _twsTop(): " + isTop
@ 07, 5 SAY " _twsLeft(): " + isLeft
@ 08, 5 SAY "_twsBottom(): " + isBottom
@ 09, 5 SAY " _twsRight(): " + isRight
@ 10, 5 SAY " _twHidden(): " + iHidden
@ 11, 5 SAY " _twColor(): " + iColor
@ 12, 5 SAY " _twShadow(): " + iShadow
@ 13, 5 SAY " _twFrame(): " + iFrame
@ 14, 5 SAY " _twFcolor(): " + iFcolor
@ 15, 5 SAY "_twCurrent(): " + iCurrent
@ 16, 5 SAY " WinLength: " + iwLength
@ 17, 5 SAY " WinWidth: " + iwWidth
IF nMainChoice == nMenuLen
INKEY( 1 )
ELSE
nKey := INKEY( 0 )
ENDIF
RESTSCREEN( 0, 3, 19, 44, tScr )
SETCOLOR( cClrTemp )
RETURN( nKey )
//------------------------------------------------------------------------
//
// FUNCTION CheckRtn( RetVal )
//
// Parameters:
//
// Return:
//
// Purpose:
//
//----- Documented: 06-15-91 at 10:00:46pm -------------------------------
FUNCTION CheckRtn( RetVal )
LOCAL aTempArray := {}, aLen, Cntr
IF VALTYPE( RetVal ) == 'N'
AADD( aTempArray, "Your Return Value Was:" )
AADD( aTempArray, "Element Number: "+STRINT( RetVal ))
// twInfo( InMsg, Header, Wait, wT, wL, sType, fType )
twInfo( aTempArray,,,,, 3, 4 )
ELSEIF VALTYPE( RetVal ) == 'A'
aLen := LEN( RetVal );Cntr:=0
AADD( aTempArray, "You Picked:" )
AEVAL( RetVal, {|| Cntr++, AADD( aTempArray, RetVal[ Cntr] ) } )
twInfo( aTempArray,,,,, 3, 4 )
ENDIF
RETURN .t.
//-------------------------------------------------------------------
//
// PROCEDURE Action1()
//
// Purpose:
//
//----- Documented: 06-15-91 at 10:00:52pm --------------------------
PROCEDURE Action1()
twInfo( { "twInfo() can be passed either a string or an array", ;
"to display. You may choose to require a keypress", ;
"to exit, display the message for a specified time, ", ;
"leave it on the screen and delete its memory from", ;
"the stack, or you may close the area later.", "", ;
"The default is to center the message on the screen, ", ;
"But you can put it anywhere. You pick the place...", ;
"We TRY to make it fit!!" }, ;
"This Uses twInfo()",,,, 1, 1 )
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE Action2()
//
// Purpose:
//
//----- Documented: 06-15-91 at 10:00:57pm --------------------------
PROCEDURE Action2()
twWarn( { "WARNING: Clipper Programming without using TSDWIN.LIB", ;
" Leads to a Loss of Valuable Relaxation Time." }, ;
"This Uses twWarn()",,,, 1, 4 )
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE Action3()
//
// Purpose:
//
//----- Documented: 06-15-91 at 10:01:01pm --------------------------
PROCEDURE Action3()
LOCAL Var2Read := SPACE( 20 )
Var2Read := twInquire( {"Try entering something.", "You can use this function", ;
"for quick and easy data", "entry!"}, ;
"twInquire() Test", Var2Read, 5, 10, 9, 2 )
twInfo( "You Entered: " + Var2Read )
RETURN
//-------------------------------------------------------------------
//
// PROCEDURE Action4()
//
// Purpose:
//
//----- Documented: 06-15-91 at 10:01:06pm --------------------------
PROCEDURE Action4()
twTextMsg( "twTextMsg() uses a long string of text as an input and "+;
"splits it up into an array or lines which are then displayed "+;
"in a box, whose size is defaulted or can be defined by the "+;
"programmer. The idea comes from a routine in Rick Spence's "+;
"new book.", ;
"This Uses twTextMsg()",, 8, 10, 16, 69,, 1, 10 )
RETURN